From 543891a0a08a89e2f6dcb7ed203f493f3afe7f2e Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Sun, 10 Jan 2016 15:37:31 +0000 Subject: [PATCH] Add support for themes (fixes #1925) --- build.go | 4 +- cmd/syncthing/gui.go | 71 +++++++++++++++--- gui/{ => default}/assets/css/overrides.css | 0 .../assets/font/raleway-500.woff | Bin gui/{ => default}/assets/font/raleway.css | 0 gui/{ => default}/assets/img/favicon.png | Bin .../assets/img/logo-horizontal.svg | Bin .../assets/img/safari-pinned-tab.svg | Bin .../assets/lang/README-FIRST.txt | 0 gui/{ => default}/assets/lang/lang-bg.json | 0 gui/{ => default}/assets/lang/lang-ca.json | 0 .../assets/lang/lang-ca@valencia.json | 0 gui/{ => default}/assets/lang/lang-cs.json | 0 gui/{ => default}/assets/lang/lang-da.json | 0 gui/{ => default}/assets/lang/lang-de.json | 0 gui/{ => default}/assets/lang/lang-el.json | 0 gui/{ => default}/assets/lang/lang-en-GB.json | 0 gui/{ => default}/assets/lang/lang-en.json | 0 gui/{ => default}/assets/lang/lang-es-ES.json | 0 gui/{ => default}/assets/lang/lang-es.json | 0 gui/{ => default}/assets/lang/lang-fi.json | 0 gui/{ => default}/assets/lang/lang-fr-CA.json | 0 gui/{ => default}/assets/lang/lang-fr.json | 0 gui/{ => default}/assets/lang/lang-fy.json | 0 gui/{ => default}/assets/lang/lang-hu.json | 0 gui/{ => default}/assets/lang/lang-it.json | 0 gui/{ => default}/assets/lang/lang-ja.json | 0 gui/{ => default}/assets/lang/lang-ko-KR.json | 0 gui/{ => default}/assets/lang/lang-lt.json | 0 gui/{ => default}/assets/lang/lang-nb.json | 0 gui/{ => default}/assets/lang/lang-nl.json | 0 gui/{ => default}/assets/lang/lang-nn.json | 0 gui/{ => default}/assets/lang/lang-pl.json | 0 gui/{ => default}/assets/lang/lang-pt-BR.json | 0 gui/{ => default}/assets/lang/lang-pt-PT.json | 0 gui/{ => default}/assets/lang/lang-ro-RO.json | 0 gui/{ => default}/assets/lang/lang-ru.json | 0 gui/{ => default}/assets/lang/lang-sv.json | 0 gui/{ => default}/assets/lang/lang-tr.json | 0 gui/{ => default}/assets/lang/lang-uk.json | 0 gui/{ => default}/assets/lang/lang-vi.json | 0 gui/{ => default}/assets/lang/lang-zh-CN.json | 0 gui/{ => default}/assets/lang/lang-zh-TW.json | 0 gui/{ => default}/assets/lang/prettyprint.js | 0 gui/{ => default}/assets/lang/valid-langs.js | 0 gui/{ => default}/index.html | 0 gui/{ => default}/modal.html | 0 gui/{ => default}/syncthing/app.js | 0 .../syncthing/core/aboutModalDirective.js | 0 .../syncthing/core/aboutModalView.html | 0 .../syncthing/core/alwaysNumberFilter.js | 0 .../syncthing/core/basenameFilter.js | 0 .../syncthing/core/binaryFilter.js | 0 .../syncthing/core/durationFilter.js | 0 .../syncthing/core/eventService.js | 0 .../core/httpErrorDialogDirective.js | 0 .../syncthing/core/httpErrorDialogView.html | 0 .../syncthing/core/identiconDirective.js | 0 .../syncthing/core/languageSelectDirective.js | 0 .../core/lastErrorComponentFilter.js | 0 .../syncthing/core/localeService.js | 0 .../core/majorUpgradeModalDirective.js | 0 .../syncthing/core/majorUpgradeModalView.html | 0 .../syncthing/core/modalDirective.js | 0 gui/{ => default}/syncthing/core/module.js | 0 .../syncthing/core/naturalFilter.js | 0 .../core/networkErrorDialogDirective.js | 0 .../core/networkErrorDialogView.html | 0 .../syncthing/core/popoverDirective.js | 0 .../core/restartingDialogDirective.js | 0 .../syncthing/core/restartingDialogView.html | 0 .../syncthing/core/selectOnClickDirective.js | 0 .../syncthing/core/shutdownDialogDirective.js | 0 .../syncthing/core/shutdownDialogView.html | 0 .../syncthing/core/syncthingController.js | 5 ++ .../syncthing/core/uniqueFolderDirective.js | 0 .../core/upgradingDialogDirective.js | 0 .../syncthing/core/upgradingDialogView.html | 0 .../syncthing/core/validDeviceidDirective.js | 0 .../device/editDeviceModalDirective.js | 0 .../syncthing/device/editDeviceModalView.html | 0 .../syncthing/device/idqrModalDirective.js | 0 .../syncthing/device/idqrModalView.html | 0 gui/{ => default}/syncthing/device/module.js | 0 .../folder/editFolderModalDirective.js | 0 .../syncthing/folder/editFolderModalView.html | 0 .../folder/editIgnoresModalDirective.js | 0 .../folder/editIgnoresModalView.html | 0 gui/{ => default}/syncthing/folder/module.js | 0 .../advancedSettingsModalDirective.js | 0 .../settings/advancedSettingsModalView.html | 0 .../syncthing/settings/module.js | 0 .../settings/settingsModalDirective.js | 0 .../syncthing/settings/settingsModalView.html | 11 ++- .../transfer/failedFilesModalDirective.js | 0 .../transfer/failedFilesModalView.html | 0 .../syncthing/transfer/module.js | 0 .../transfer/neededFilesModalDirective.js | 0 .../transfer/neededFilesModalView.html | 0 .../syncthing/usagereport/module.js | 0 .../usagereport/usageReportModalDirective.js | 0 .../usagereport/usageReportModalView.html | 0 .../usageReportPreviewModalDirective.js | 0 .../usageReportPreviewModalView.html | 0 .../vendor/angular/angular-dirPagination.js | 0 .../angular/angular-translate-loader.min.js | 0 .../vendor/angular/angular-translate.min.js | 0 .../vendor/angular/angular.min.js | 0 .../vendor/bootstrap/config.json | 0 .../vendor/bootstrap/css/bootstrap-theme.css | 0 .../bootstrap/css/bootstrap-theme.min.css | 0 .../vendor/bootstrap/css/bootstrap.css | 0 .../vendor/bootstrap/css/bootstrap.min.css | 0 .../vendor/bootstrap/js/bootstrap.js | 0 .../vendor/bootstrap/js/bootstrap.min.js | 0 .../font-awesome/css/font-awesome.min.css | 0 .../vendor/font-awesome/fonts/FontAwesome.otf | Bin .../fonts/fontawesome-webfont.eot | Bin .../fonts/fontawesome-webfont.svg | Bin .../fonts/fontawesome-webfont.ttf | Bin .../fonts/fontawesome-webfont.woff | Bin .../fonts/fontawesome-webfont.woff2 | Bin .../vendor/jquery/jquery-2.0.3.min.js | 0 lib/auto/auto_test.go | 2 +- lib/config/config.go | 3 + lib/config/guiconfiguration.go | 1 + script/authors.go | 2 +- 127 files changed, 83 insertions(+), 16 deletions(-) rename gui/{ => default}/assets/css/overrides.css (100%) rename gui/{ => default}/assets/font/raleway-500.woff (100%) rename gui/{ => default}/assets/font/raleway.css (100%) rename gui/{ => default}/assets/img/favicon.png (100%) rename gui/{ => default}/assets/img/logo-horizontal.svg (100%) rename gui/{ => default}/assets/img/safari-pinned-tab.svg (100%) rename gui/{ => default}/assets/lang/README-FIRST.txt (100%) rename gui/{ => default}/assets/lang/lang-bg.json (100%) rename gui/{ => default}/assets/lang/lang-ca.json (100%) rename gui/{ => default}/assets/lang/lang-ca@valencia.json (100%) rename gui/{ => default}/assets/lang/lang-cs.json (100%) rename gui/{ => default}/assets/lang/lang-da.json (100%) rename gui/{ => default}/assets/lang/lang-de.json (100%) rename gui/{ => default}/assets/lang/lang-el.json (100%) rename gui/{ => default}/assets/lang/lang-en-GB.json (100%) rename gui/{ => default}/assets/lang/lang-en.json (100%) rename gui/{ => default}/assets/lang/lang-es-ES.json (100%) rename gui/{ => default}/assets/lang/lang-es.json (100%) rename gui/{ => default}/assets/lang/lang-fi.json (100%) rename gui/{ => default}/assets/lang/lang-fr-CA.json (100%) rename gui/{ => default}/assets/lang/lang-fr.json (100%) rename gui/{ => default}/assets/lang/lang-fy.json (100%) rename gui/{ => default}/assets/lang/lang-hu.json (100%) rename gui/{ => default}/assets/lang/lang-it.json (100%) rename gui/{ => default}/assets/lang/lang-ja.json (100%) rename gui/{ => default}/assets/lang/lang-ko-KR.json (100%) rename gui/{ => default}/assets/lang/lang-lt.json (100%) rename gui/{ => default}/assets/lang/lang-nb.json (100%) rename gui/{ => default}/assets/lang/lang-nl.json (100%) rename gui/{ => default}/assets/lang/lang-nn.json (100%) rename gui/{ => default}/assets/lang/lang-pl.json (100%) rename gui/{ => default}/assets/lang/lang-pt-BR.json (100%) rename gui/{ => default}/assets/lang/lang-pt-PT.json (100%) rename gui/{ => default}/assets/lang/lang-ro-RO.json (100%) rename gui/{ => default}/assets/lang/lang-ru.json (100%) rename gui/{ => default}/assets/lang/lang-sv.json (100%) rename gui/{ => default}/assets/lang/lang-tr.json (100%) rename gui/{ => default}/assets/lang/lang-uk.json (100%) rename gui/{ => default}/assets/lang/lang-vi.json (100%) rename gui/{ => default}/assets/lang/lang-zh-CN.json (100%) rename gui/{ => default}/assets/lang/lang-zh-TW.json (100%) rename gui/{ => default}/assets/lang/prettyprint.js (100%) rename gui/{ => default}/assets/lang/valid-langs.js (100%) rename gui/{ => default}/index.html (100%) rename gui/{ => default}/modal.html (100%) rename gui/{ => default}/syncthing/app.js (100%) rename gui/{ => default}/syncthing/core/aboutModalDirective.js (100%) rename gui/{ => default}/syncthing/core/aboutModalView.html (100%) rename gui/{ => default}/syncthing/core/alwaysNumberFilter.js (100%) rename gui/{ => default}/syncthing/core/basenameFilter.js (100%) rename gui/{ => default}/syncthing/core/binaryFilter.js (100%) rename gui/{ => default}/syncthing/core/durationFilter.js (100%) rename gui/{ => default}/syncthing/core/eventService.js (100%) rename gui/{ => default}/syncthing/core/httpErrorDialogDirective.js (100%) rename gui/{ => default}/syncthing/core/httpErrorDialogView.html (100%) rename gui/{ => default}/syncthing/core/identiconDirective.js (100%) rename gui/{ => default}/syncthing/core/languageSelectDirective.js (100%) rename gui/{ => default}/syncthing/core/lastErrorComponentFilter.js (100%) rename gui/{ => default}/syncthing/core/localeService.js (100%) rename gui/{ => default}/syncthing/core/majorUpgradeModalDirective.js (100%) rename gui/{ => default}/syncthing/core/majorUpgradeModalView.html (100%) rename gui/{ => default}/syncthing/core/modalDirective.js (100%) rename gui/{ => default}/syncthing/core/module.js (100%) rename gui/{ => default}/syncthing/core/naturalFilter.js (100%) rename gui/{ => default}/syncthing/core/networkErrorDialogDirective.js (100%) rename gui/{ => default}/syncthing/core/networkErrorDialogView.html (100%) rename gui/{ => default}/syncthing/core/popoverDirective.js (100%) rename gui/{ => default}/syncthing/core/restartingDialogDirective.js (100%) rename gui/{ => default}/syncthing/core/restartingDialogView.html (100%) rename gui/{ => default}/syncthing/core/selectOnClickDirective.js (100%) rename gui/{ => default}/syncthing/core/shutdownDialogDirective.js (100%) rename gui/{ => default}/syncthing/core/shutdownDialogView.html (100%) rename gui/{ => default}/syncthing/core/syncthingController.js (99%) rename gui/{ => default}/syncthing/core/uniqueFolderDirective.js (100%) rename gui/{ => default}/syncthing/core/upgradingDialogDirective.js (100%) rename gui/{ => default}/syncthing/core/upgradingDialogView.html (100%) rename gui/{ => default}/syncthing/core/validDeviceidDirective.js (100%) rename gui/{ => default}/syncthing/device/editDeviceModalDirective.js (100%) rename gui/{ => default}/syncthing/device/editDeviceModalView.html (100%) rename gui/{ => default}/syncthing/device/idqrModalDirective.js (100%) rename gui/{ => default}/syncthing/device/idqrModalView.html (100%) rename gui/{ => default}/syncthing/device/module.js (100%) rename gui/{ => default}/syncthing/folder/editFolderModalDirective.js (100%) rename gui/{ => default}/syncthing/folder/editFolderModalView.html (100%) rename gui/{ => default}/syncthing/folder/editIgnoresModalDirective.js (100%) rename gui/{ => default}/syncthing/folder/editIgnoresModalView.html (100%) rename gui/{ => default}/syncthing/folder/module.js (100%) rename gui/{ => default}/syncthing/settings/advancedSettingsModalDirective.js (100%) rename gui/{ => default}/syncthing/settings/advancedSettingsModalView.html (100%) rename gui/{ => default}/syncthing/settings/module.js (100%) rename gui/{ => default}/syncthing/settings/settingsModalDirective.js (100%) rename gui/{ => default}/syncthing/settings/settingsModalView.html (94%) rename gui/{ => default}/syncthing/transfer/failedFilesModalDirective.js (100%) rename gui/{ => default}/syncthing/transfer/failedFilesModalView.html (100%) rename gui/{ => default}/syncthing/transfer/module.js (100%) rename gui/{ => default}/syncthing/transfer/neededFilesModalDirective.js (100%) rename gui/{ => default}/syncthing/transfer/neededFilesModalView.html (100%) rename gui/{ => default}/syncthing/usagereport/module.js (100%) rename gui/{ => default}/syncthing/usagereport/usageReportModalDirective.js (100%) rename gui/{ => default}/syncthing/usagereport/usageReportModalView.html (100%) rename gui/{ => default}/syncthing/usagereport/usageReportPreviewModalDirective.js (100%) rename gui/{ => default}/syncthing/usagereport/usageReportPreviewModalView.html (100%) rename gui/{ => default}/vendor/angular/angular-dirPagination.js (100%) rename gui/{ => default}/vendor/angular/angular-translate-loader.min.js (100%) rename gui/{ => default}/vendor/angular/angular-translate.min.js (100%) rename gui/{ => default}/vendor/angular/angular.min.js (100%) rename gui/{ => default}/vendor/bootstrap/config.json (100%) rename gui/{ => default}/vendor/bootstrap/css/bootstrap-theme.css (100%) rename gui/{ => default}/vendor/bootstrap/css/bootstrap-theme.min.css (100%) rename gui/{ => default}/vendor/bootstrap/css/bootstrap.css (100%) rename gui/{ => default}/vendor/bootstrap/css/bootstrap.min.css (100%) rename gui/{ => default}/vendor/bootstrap/js/bootstrap.js (100%) rename gui/{ => default}/vendor/bootstrap/js/bootstrap.min.js (100%) rename gui/{ => default}/vendor/font-awesome/css/font-awesome.min.css (100%) rename gui/{ => default}/vendor/font-awesome/fonts/FontAwesome.otf (100%) rename gui/{ => default}/vendor/font-awesome/fonts/fontawesome-webfont.eot (100%) rename gui/{ => default}/vendor/font-awesome/fonts/fontawesome-webfont.svg (100%) rename gui/{ => default}/vendor/font-awesome/fonts/fontawesome-webfont.ttf (100%) rename gui/{ => default}/vendor/font-awesome/fonts/fontawesome-webfont.woff (100%) rename gui/{ => default}/vendor/font-awesome/fonts/fontawesome-webfont.woff2 (100%) rename gui/{ => default}/vendor/jquery/jquery-2.0.3.min.js (100%) diff --git a/build.go b/build.go index 948305e80..4640ac143 100644 --- a/build.go +++ b/build.go @@ -410,7 +410,7 @@ func xdr() { } func translate() { - os.Chdir("gui/assets/lang") + os.Chdir("gui/default/assets/lang") runPipe("lang-en-new.json", "go", "run", "../../../script/translate.go", "lang-en.json", "../../") os.Remove("lang-en.json") err := os.Rename("lang-en-new.json", "lang-en.json") @@ -421,7 +421,7 @@ func translate() { } func transifex() { - os.Chdir("gui/assets/lang") + os.Chdir("gui/default/assets/lang") runPrint("go", "run", "../../../script/transifexdl.go") os.Chdir("../../..") assets() diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 1f328e26e..38b9672e0 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -52,6 +52,7 @@ type apiService struct { id protocol.DeviceID cfg *config.Wrapper assetDir string + themes []string model *model.Model eventSub *events.BufferedSubscription discoverer *discover.CachingMux @@ -79,6 +80,15 @@ func newAPIService(id protocol.DeviceID, cfg *config.Wrapper, assetDir string, m systemLog: systemLog, } + seen := make(map[string]struct{}) + for file := range auto.Assets() { + theme := strings.Split(file, "/")[0] + if _, ok := seen[theme]; !ok { + seen[theme] = struct{}{} + service.themes = append(service.themes, theme) + } + } + var err error service.listener, err = service.getListener(cfg.GUI()) return service, err @@ -198,10 +208,16 @@ func (s *apiService) Serve() { mux.HandleFunc("/qr/", s.getQR) // Serve compiled in assets unless an asset directory was set (for development) - mux.Handle("/", embeddedStatic{ - assetDir: s.assetDir, - assets: auto.Assets(), - }) + assets := &embeddedStatic{ + theme: s.cfg.GUI().Theme, + lastModified: time.Now(), + mut: sync.NewRWMutex(), + assetDir: s.assetDir, + assets: auto.Assets(), + } + mux.Handle("/", assets) + + s.cfg.Subscribe(assets) guiCfg := s.cfg.GUI() @@ -690,6 +706,7 @@ func (s *apiService) getSystemStatus(w http.ResponseWriter, r *http.Request) { res["pathSeparator"] = string(filepath.Separator) res["uptime"] = int(time.Since(startTime).Seconds()) res["startTime"] = startTime + res["themes"] = s.themes sendJSON(w, res) } @@ -1015,8 +1032,11 @@ func (s *apiService) getSystemBrowse(w http.ResponseWriter, r *http.Request) { } type embeddedStatic struct { - assetDir string - assets map[string][]byte + theme string + lastModified time.Time + mut sync.RWMutex + assetDir string + assets map[string][]byte } func (s embeddedStatic) ServeHTTP(w http.ResponseWriter, r *http.Request) { @@ -1039,13 +1059,21 @@ func (s embeddedStatic) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } - bs, ok := s.assets[file] + s.mut.RLock() + theme := s.theme + modified := s.lastModified + s.mut.RUnlock() + + bs, ok := s.assets[theme+"/"+file] if !ok { - http.NotFound(w, r) - return + bs, ok = s.assets[config.DefaultTheme+"/"+file] + if !ok { + http.NotFound(w, r) + return + } } - if r.Header.Get("If-Modified-Since") == auto.AssetsBuildDate { + if modifiedSince, err := time.Parse(r.Header.Get("If-Modified-Since"), http.TimeFormat); err == nil && modified.Before(modifiedSince) { w.WriteHeader(http.StatusNotModified) return } @@ -1064,7 +1092,7 @@ func (s embeddedStatic) ServeHTTP(w http.ResponseWriter, r *http.Request) { gr.Close() } w.Header().Set("Content-Length", fmt.Sprintf("%d", len(bs))) - w.Header().Set("Last-Modified", auto.AssetsBuildDate) + w.Header().Set("Last-Modified", modified.Format(http.TimeFormat)) w.Header().Set("Cache-Control", "public") w.Write(bs) @@ -1097,6 +1125,27 @@ func (s embeddedStatic) mimeTypeForFile(file string) string { } } +// VerifyConfiguration implements the config.Committer interface +func (s *embeddedStatic) VerifyConfiguration(from, to config.Configuration) error { + return nil +} + +// CommitConfiguration implements the config.Committer interface +func (s *embeddedStatic) CommitConfiguration(from, to config.Configuration) bool { + s.mut.Lock() + if s.theme != to.GUI.Theme { + s.theme = to.GUI.Theme + s.lastModified = time.Now() + } + s.mut.Unlock() + + return true +} + +func (s *embeddedStatic) String() string { + return fmt.Sprintf("embeddedStatic@%p", s) +} + func (s *apiService) toNeedSlice(fs []db.FileInfoTruncated) []jsonDBFileInfo { res := make([]jsonDBFileInfo, len(fs)) for i, f := range fs { diff --git a/gui/assets/css/overrides.css b/gui/default/assets/css/overrides.css similarity index 100% rename from gui/assets/css/overrides.css rename to gui/default/assets/css/overrides.css diff --git a/gui/assets/font/raleway-500.woff b/gui/default/assets/font/raleway-500.woff similarity index 100% rename from gui/assets/font/raleway-500.woff rename to gui/default/assets/font/raleway-500.woff diff --git a/gui/assets/font/raleway.css b/gui/default/assets/font/raleway.css similarity index 100% rename from gui/assets/font/raleway.css rename to gui/default/assets/font/raleway.css diff --git a/gui/assets/img/favicon.png b/gui/default/assets/img/favicon.png similarity index 100% rename from gui/assets/img/favicon.png rename to gui/default/assets/img/favicon.png diff --git a/gui/assets/img/logo-horizontal.svg b/gui/default/assets/img/logo-horizontal.svg similarity index 100% rename from gui/assets/img/logo-horizontal.svg rename to gui/default/assets/img/logo-horizontal.svg diff --git a/gui/assets/img/safari-pinned-tab.svg b/gui/default/assets/img/safari-pinned-tab.svg similarity index 100% rename from gui/assets/img/safari-pinned-tab.svg rename to gui/default/assets/img/safari-pinned-tab.svg diff --git a/gui/assets/lang/README-FIRST.txt b/gui/default/assets/lang/README-FIRST.txt similarity index 100% rename from gui/assets/lang/README-FIRST.txt rename to gui/default/assets/lang/README-FIRST.txt diff --git a/gui/assets/lang/lang-bg.json b/gui/default/assets/lang/lang-bg.json similarity index 100% rename from gui/assets/lang/lang-bg.json rename to gui/default/assets/lang/lang-bg.json diff --git a/gui/assets/lang/lang-ca.json b/gui/default/assets/lang/lang-ca.json similarity index 100% rename from gui/assets/lang/lang-ca.json rename to gui/default/assets/lang/lang-ca.json diff --git a/gui/assets/lang/lang-ca@valencia.json b/gui/default/assets/lang/lang-ca@valencia.json similarity index 100% rename from gui/assets/lang/lang-ca@valencia.json rename to gui/default/assets/lang/lang-ca@valencia.json diff --git a/gui/assets/lang/lang-cs.json b/gui/default/assets/lang/lang-cs.json similarity index 100% rename from gui/assets/lang/lang-cs.json rename to gui/default/assets/lang/lang-cs.json diff --git a/gui/assets/lang/lang-da.json b/gui/default/assets/lang/lang-da.json similarity index 100% rename from gui/assets/lang/lang-da.json rename to gui/default/assets/lang/lang-da.json diff --git a/gui/assets/lang/lang-de.json b/gui/default/assets/lang/lang-de.json similarity index 100% rename from gui/assets/lang/lang-de.json rename to gui/default/assets/lang/lang-de.json diff --git a/gui/assets/lang/lang-el.json b/gui/default/assets/lang/lang-el.json similarity index 100% rename from gui/assets/lang/lang-el.json rename to gui/default/assets/lang/lang-el.json diff --git a/gui/assets/lang/lang-en-GB.json b/gui/default/assets/lang/lang-en-GB.json similarity index 100% rename from gui/assets/lang/lang-en-GB.json rename to gui/default/assets/lang/lang-en-GB.json diff --git a/gui/assets/lang/lang-en.json b/gui/default/assets/lang/lang-en.json similarity index 100% rename from gui/assets/lang/lang-en.json rename to gui/default/assets/lang/lang-en.json diff --git a/gui/assets/lang/lang-es-ES.json b/gui/default/assets/lang/lang-es-ES.json similarity index 100% rename from gui/assets/lang/lang-es-ES.json rename to gui/default/assets/lang/lang-es-ES.json diff --git a/gui/assets/lang/lang-es.json b/gui/default/assets/lang/lang-es.json similarity index 100% rename from gui/assets/lang/lang-es.json rename to gui/default/assets/lang/lang-es.json diff --git a/gui/assets/lang/lang-fi.json b/gui/default/assets/lang/lang-fi.json similarity index 100% rename from gui/assets/lang/lang-fi.json rename to gui/default/assets/lang/lang-fi.json diff --git a/gui/assets/lang/lang-fr-CA.json b/gui/default/assets/lang/lang-fr-CA.json similarity index 100% rename from gui/assets/lang/lang-fr-CA.json rename to gui/default/assets/lang/lang-fr-CA.json diff --git a/gui/assets/lang/lang-fr.json b/gui/default/assets/lang/lang-fr.json similarity index 100% rename from gui/assets/lang/lang-fr.json rename to gui/default/assets/lang/lang-fr.json diff --git a/gui/assets/lang/lang-fy.json b/gui/default/assets/lang/lang-fy.json similarity index 100% rename from gui/assets/lang/lang-fy.json rename to gui/default/assets/lang/lang-fy.json diff --git a/gui/assets/lang/lang-hu.json b/gui/default/assets/lang/lang-hu.json similarity index 100% rename from gui/assets/lang/lang-hu.json rename to gui/default/assets/lang/lang-hu.json diff --git a/gui/assets/lang/lang-it.json b/gui/default/assets/lang/lang-it.json similarity index 100% rename from gui/assets/lang/lang-it.json rename to gui/default/assets/lang/lang-it.json diff --git a/gui/assets/lang/lang-ja.json b/gui/default/assets/lang/lang-ja.json similarity index 100% rename from gui/assets/lang/lang-ja.json rename to gui/default/assets/lang/lang-ja.json diff --git a/gui/assets/lang/lang-ko-KR.json b/gui/default/assets/lang/lang-ko-KR.json similarity index 100% rename from gui/assets/lang/lang-ko-KR.json rename to gui/default/assets/lang/lang-ko-KR.json diff --git a/gui/assets/lang/lang-lt.json b/gui/default/assets/lang/lang-lt.json similarity index 100% rename from gui/assets/lang/lang-lt.json rename to gui/default/assets/lang/lang-lt.json diff --git a/gui/assets/lang/lang-nb.json b/gui/default/assets/lang/lang-nb.json similarity index 100% rename from gui/assets/lang/lang-nb.json rename to gui/default/assets/lang/lang-nb.json diff --git a/gui/assets/lang/lang-nl.json b/gui/default/assets/lang/lang-nl.json similarity index 100% rename from gui/assets/lang/lang-nl.json rename to gui/default/assets/lang/lang-nl.json diff --git a/gui/assets/lang/lang-nn.json b/gui/default/assets/lang/lang-nn.json similarity index 100% rename from gui/assets/lang/lang-nn.json rename to gui/default/assets/lang/lang-nn.json diff --git a/gui/assets/lang/lang-pl.json b/gui/default/assets/lang/lang-pl.json similarity index 100% rename from gui/assets/lang/lang-pl.json rename to gui/default/assets/lang/lang-pl.json diff --git a/gui/assets/lang/lang-pt-BR.json b/gui/default/assets/lang/lang-pt-BR.json similarity index 100% rename from gui/assets/lang/lang-pt-BR.json rename to gui/default/assets/lang/lang-pt-BR.json diff --git a/gui/assets/lang/lang-pt-PT.json b/gui/default/assets/lang/lang-pt-PT.json similarity index 100% rename from gui/assets/lang/lang-pt-PT.json rename to gui/default/assets/lang/lang-pt-PT.json diff --git a/gui/assets/lang/lang-ro-RO.json b/gui/default/assets/lang/lang-ro-RO.json similarity index 100% rename from gui/assets/lang/lang-ro-RO.json rename to gui/default/assets/lang/lang-ro-RO.json diff --git a/gui/assets/lang/lang-ru.json b/gui/default/assets/lang/lang-ru.json similarity index 100% rename from gui/assets/lang/lang-ru.json rename to gui/default/assets/lang/lang-ru.json diff --git a/gui/assets/lang/lang-sv.json b/gui/default/assets/lang/lang-sv.json similarity index 100% rename from gui/assets/lang/lang-sv.json rename to gui/default/assets/lang/lang-sv.json diff --git a/gui/assets/lang/lang-tr.json b/gui/default/assets/lang/lang-tr.json similarity index 100% rename from gui/assets/lang/lang-tr.json rename to gui/default/assets/lang/lang-tr.json diff --git a/gui/assets/lang/lang-uk.json b/gui/default/assets/lang/lang-uk.json similarity index 100% rename from gui/assets/lang/lang-uk.json rename to gui/default/assets/lang/lang-uk.json diff --git a/gui/assets/lang/lang-vi.json b/gui/default/assets/lang/lang-vi.json similarity index 100% rename from gui/assets/lang/lang-vi.json rename to gui/default/assets/lang/lang-vi.json diff --git a/gui/assets/lang/lang-zh-CN.json b/gui/default/assets/lang/lang-zh-CN.json similarity index 100% rename from gui/assets/lang/lang-zh-CN.json rename to gui/default/assets/lang/lang-zh-CN.json diff --git a/gui/assets/lang/lang-zh-TW.json b/gui/default/assets/lang/lang-zh-TW.json similarity index 100% rename from gui/assets/lang/lang-zh-TW.json rename to gui/default/assets/lang/lang-zh-TW.json diff --git a/gui/assets/lang/prettyprint.js b/gui/default/assets/lang/prettyprint.js similarity index 100% rename from gui/assets/lang/prettyprint.js rename to gui/default/assets/lang/prettyprint.js diff --git a/gui/assets/lang/valid-langs.js b/gui/default/assets/lang/valid-langs.js similarity index 100% rename from gui/assets/lang/valid-langs.js rename to gui/default/assets/lang/valid-langs.js diff --git a/gui/index.html b/gui/default/index.html similarity index 100% rename from gui/index.html rename to gui/default/index.html diff --git a/gui/modal.html b/gui/default/modal.html similarity index 100% rename from gui/modal.html rename to gui/default/modal.html diff --git a/gui/syncthing/app.js b/gui/default/syncthing/app.js similarity index 100% rename from gui/syncthing/app.js rename to gui/default/syncthing/app.js diff --git a/gui/syncthing/core/aboutModalDirective.js b/gui/default/syncthing/core/aboutModalDirective.js similarity index 100% rename from gui/syncthing/core/aboutModalDirective.js rename to gui/default/syncthing/core/aboutModalDirective.js diff --git a/gui/syncthing/core/aboutModalView.html b/gui/default/syncthing/core/aboutModalView.html similarity index 100% rename from gui/syncthing/core/aboutModalView.html rename to gui/default/syncthing/core/aboutModalView.html diff --git a/gui/syncthing/core/alwaysNumberFilter.js b/gui/default/syncthing/core/alwaysNumberFilter.js similarity index 100% rename from gui/syncthing/core/alwaysNumberFilter.js rename to gui/default/syncthing/core/alwaysNumberFilter.js diff --git a/gui/syncthing/core/basenameFilter.js b/gui/default/syncthing/core/basenameFilter.js similarity index 100% rename from gui/syncthing/core/basenameFilter.js rename to gui/default/syncthing/core/basenameFilter.js diff --git a/gui/syncthing/core/binaryFilter.js b/gui/default/syncthing/core/binaryFilter.js similarity index 100% rename from gui/syncthing/core/binaryFilter.js rename to gui/default/syncthing/core/binaryFilter.js diff --git a/gui/syncthing/core/durationFilter.js b/gui/default/syncthing/core/durationFilter.js similarity index 100% rename from gui/syncthing/core/durationFilter.js rename to gui/default/syncthing/core/durationFilter.js diff --git a/gui/syncthing/core/eventService.js b/gui/default/syncthing/core/eventService.js similarity index 100% rename from gui/syncthing/core/eventService.js rename to gui/default/syncthing/core/eventService.js diff --git a/gui/syncthing/core/httpErrorDialogDirective.js b/gui/default/syncthing/core/httpErrorDialogDirective.js similarity index 100% rename from gui/syncthing/core/httpErrorDialogDirective.js rename to gui/default/syncthing/core/httpErrorDialogDirective.js diff --git a/gui/syncthing/core/httpErrorDialogView.html b/gui/default/syncthing/core/httpErrorDialogView.html similarity index 100% rename from gui/syncthing/core/httpErrorDialogView.html rename to gui/default/syncthing/core/httpErrorDialogView.html diff --git a/gui/syncthing/core/identiconDirective.js b/gui/default/syncthing/core/identiconDirective.js similarity index 100% rename from gui/syncthing/core/identiconDirective.js rename to gui/default/syncthing/core/identiconDirective.js diff --git a/gui/syncthing/core/languageSelectDirective.js b/gui/default/syncthing/core/languageSelectDirective.js similarity index 100% rename from gui/syncthing/core/languageSelectDirective.js rename to gui/default/syncthing/core/languageSelectDirective.js diff --git a/gui/syncthing/core/lastErrorComponentFilter.js b/gui/default/syncthing/core/lastErrorComponentFilter.js similarity index 100% rename from gui/syncthing/core/lastErrorComponentFilter.js rename to gui/default/syncthing/core/lastErrorComponentFilter.js diff --git a/gui/syncthing/core/localeService.js b/gui/default/syncthing/core/localeService.js similarity index 100% rename from gui/syncthing/core/localeService.js rename to gui/default/syncthing/core/localeService.js diff --git a/gui/syncthing/core/majorUpgradeModalDirective.js b/gui/default/syncthing/core/majorUpgradeModalDirective.js similarity index 100% rename from gui/syncthing/core/majorUpgradeModalDirective.js rename to gui/default/syncthing/core/majorUpgradeModalDirective.js diff --git a/gui/syncthing/core/majorUpgradeModalView.html b/gui/default/syncthing/core/majorUpgradeModalView.html similarity index 100% rename from gui/syncthing/core/majorUpgradeModalView.html rename to gui/default/syncthing/core/majorUpgradeModalView.html diff --git a/gui/syncthing/core/modalDirective.js b/gui/default/syncthing/core/modalDirective.js similarity index 100% rename from gui/syncthing/core/modalDirective.js rename to gui/default/syncthing/core/modalDirective.js diff --git a/gui/syncthing/core/module.js b/gui/default/syncthing/core/module.js similarity index 100% rename from gui/syncthing/core/module.js rename to gui/default/syncthing/core/module.js diff --git a/gui/syncthing/core/naturalFilter.js b/gui/default/syncthing/core/naturalFilter.js similarity index 100% rename from gui/syncthing/core/naturalFilter.js rename to gui/default/syncthing/core/naturalFilter.js diff --git a/gui/syncthing/core/networkErrorDialogDirective.js b/gui/default/syncthing/core/networkErrorDialogDirective.js similarity index 100% rename from gui/syncthing/core/networkErrorDialogDirective.js rename to gui/default/syncthing/core/networkErrorDialogDirective.js diff --git a/gui/syncthing/core/networkErrorDialogView.html b/gui/default/syncthing/core/networkErrorDialogView.html similarity index 100% rename from gui/syncthing/core/networkErrorDialogView.html rename to gui/default/syncthing/core/networkErrorDialogView.html diff --git a/gui/syncthing/core/popoverDirective.js b/gui/default/syncthing/core/popoverDirective.js similarity index 100% rename from gui/syncthing/core/popoverDirective.js rename to gui/default/syncthing/core/popoverDirective.js diff --git a/gui/syncthing/core/restartingDialogDirective.js b/gui/default/syncthing/core/restartingDialogDirective.js similarity index 100% rename from gui/syncthing/core/restartingDialogDirective.js rename to gui/default/syncthing/core/restartingDialogDirective.js diff --git a/gui/syncthing/core/restartingDialogView.html b/gui/default/syncthing/core/restartingDialogView.html similarity index 100% rename from gui/syncthing/core/restartingDialogView.html rename to gui/default/syncthing/core/restartingDialogView.html diff --git a/gui/syncthing/core/selectOnClickDirective.js b/gui/default/syncthing/core/selectOnClickDirective.js similarity index 100% rename from gui/syncthing/core/selectOnClickDirective.js rename to gui/default/syncthing/core/selectOnClickDirective.js diff --git a/gui/syncthing/core/shutdownDialogDirective.js b/gui/default/syncthing/core/shutdownDialogDirective.js similarity index 100% rename from gui/syncthing/core/shutdownDialogDirective.js rename to gui/default/syncthing/core/shutdownDialogDirective.js diff --git a/gui/syncthing/core/shutdownDialogView.html b/gui/default/syncthing/core/shutdownDialogView.html similarity index 100% rename from gui/syncthing/core/shutdownDialogView.html rename to gui/default/syncthing/core/shutdownDialogView.html diff --git a/gui/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js similarity index 99% rename from gui/syncthing/core/syncthingController.js rename to gui/default/syncthing/core/syncthingController.js index fd8a6cc3c..eabd4c37a 100755 --- a/gui/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -866,6 +866,7 @@ angular.module('syncthing.core') $scope.saveSettings = function () { // Make sure something changed var changed = !angular.equals($scope.config.options, $scope.tmpOptions) || !angular.equals($scope.config.gui, $scope.tmpGUI); + var themeChanged = $scope.config.gui.theme !== $scope.tmpGUI.theme; if (changed) { // Check if usage reporting has been enabled or disabled if ($scope.tmpOptions.urEnabled && $scope.tmpOptions.urAccepted <= 0) { @@ -901,6 +902,10 @@ angular.module('syncthing.core') } $('#settings').modal("hide"); + + if (themeChanged) { + document.location.reload(true); + } }; $scope.saveAdvanced = function () { diff --git a/gui/syncthing/core/uniqueFolderDirective.js b/gui/default/syncthing/core/uniqueFolderDirective.js similarity index 100% rename from gui/syncthing/core/uniqueFolderDirective.js rename to gui/default/syncthing/core/uniqueFolderDirective.js diff --git a/gui/syncthing/core/upgradingDialogDirective.js b/gui/default/syncthing/core/upgradingDialogDirective.js similarity index 100% rename from gui/syncthing/core/upgradingDialogDirective.js rename to gui/default/syncthing/core/upgradingDialogDirective.js diff --git a/gui/syncthing/core/upgradingDialogView.html b/gui/default/syncthing/core/upgradingDialogView.html similarity index 100% rename from gui/syncthing/core/upgradingDialogView.html rename to gui/default/syncthing/core/upgradingDialogView.html diff --git a/gui/syncthing/core/validDeviceidDirective.js b/gui/default/syncthing/core/validDeviceidDirective.js similarity index 100% rename from gui/syncthing/core/validDeviceidDirective.js rename to gui/default/syncthing/core/validDeviceidDirective.js diff --git a/gui/syncthing/device/editDeviceModalDirective.js b/gui/default/syncthing/device/editDeviceModalDirective.js similarity index 100% rename from gui/syncthing/device/editDeviceModalDirective.js rename to gui/default/syncthing/device/editDeviceModalDirective.js diff --git a/gui/syncthing/device/editDeviceModalView.html b/gui/default/syncthing/device/editDeviceModalView.html similarity index 100% rename from gui/syncthing/device/editDeviceModalView.html rename to gui/default/syncthing/device/editDeviceModalView.html diff --git a/gui/syncthing/device/idqrModalDirective.js b/gui/default/syncthing/device/idqrModalDirective.js similarity index 100% rename from gui/syncthing/device/idqrModalDirective.js rename to gui/default/syncthing/device/idqrModalDirective.js diff --git a/gui/syncthing/device/idqrModalView.html b/gui/default/syncthing/device/idqrModalView.html similarity index 100% rename from gui/syncthing/device/idqrModalView.html rename to gui/default/syncthing/device/idqrModalView.html diff --git a/gui/syncthing/device/module.js b/gui/default/syncthing/device/module.js similarity index 100% rename from gui/syncthing/device/module.js rename to gui/default/syncthing/device/module.js diff --git a/gui/syncthing/folder/editFolderModalDirective.js b/gui/default/syncthing/folder/editFolderModalDirective.js similarity index 100% rename from gui/syncthing/folder/editFolderModalDirective.js rename to gui/default/syncthing/folder/editFolderModalDirective.js diff --git a/gui/syncthing/folder/editFolderModalView.html b/gui/default/syncthing/folder/editFolderModalView.html similarity index 100% rename from gui/syncthing/folder/editFolderModalView.html rename to gui/default/syncthing/folder/editFolderModalView.html diff --git a/gui/syncthing/folder/editIgnoresModalDirective.js b/gui/default/syncthing/folder/editIgnoresModalDirective.js similarity index 100% rename from gui/syncthing/folder/editIgnoresModalDirective.js rename to gui/default/syncthing/folder/editIgnoresModalDirective.js diff --git a/gui/syncthing/folder/editIgnoresModalView.html b/gui/default/syncthing/folder/editIgnoresModalView.html similarity index 100% rename from gui/syncthing/folder/editIgnoresModalView.html rename to gui/default/syncthing/folder/editIgnoresModalView.html diff --git a/gui/syncthing/folder/module.js b/gui/default/syncthing/folder/module.js similarity index 100% rename from gui/syncthing/folder/module.js rename to gui/default/syncthing/folder/module.js diff --git a/gui/syncthing/settings/advancedSettingsModalDirective.js b/gui/default/syncthing/settings/advancedSettingsModalDirective.js similarity index 100% rename from gui/syncthing/settings/advancedSettingsModalDirective.js rename to gui/default/syncthing/settings/advancedSettingsModalDirective.js diff --git a/gui/syncthing/settings/advancedSettingsModalView.html b/gui/default/syncthing/settings/advancedSettingsModalView.html similarity index 100% rename from gui/syncthing/settings/advancedSettingsModalView.html rename to gui/default/syncthing/settings/advancedSettingsModalView.html diff --git a/gui/syncthing/settings/module.js b/gui/default/syncthing/settings/module.js similarity index 100% rename from gui/syncthing/settings/module.js rename to gui/default/syncthing/settings/module.js diff --git a/gui/syncthing/settings/settingsModalDirective.js b/gui/default/syncthing/settings/settingsModalDirective.js similarity index 100% rename from gui/syncthing/settings/settingsModalDirective.js rename to gui/default/syncthing/settings/settingsModalDirective.js diff --git a/gui/syncthing/settings/settingsModalView.html b/gui/default/syncthing/settings/settingsModalView.html similarity index 94% rename from gui/syncthing/settings/settingsModalView.html rename to gui/default/syncthing/settings/settingsModalView.html index f4e01ca4e..15d73ab45 100644 --- a/gui/syncthing/settings/settingsModalView.html +++ b/gui/default/syncthing/settings/settingsModalView.html @@ -136,8 +136,17 @@  Generate - +
+ + +
+ + diff --git a/gui/syncthing/transfer/failedFilesModalDirective.js b/gui/default/syncthing/transfer/failedFilesModalDirective.js similarity index 100% rename from gui/syncthing/transfer/failedFilesModalDirective.js rename to gui/default/syncthing/transfer/failedFilesModalDirective.js diff --git a/gui/syncthing/transfer/failedFilesModalView.html b/gui/default/syncthing/transfer/failedFilesModalView.html similarity index 100% rename from gui/syncthing/transfer/failedFilesModalView.html rename to gui/default/syncthing/transfer/failedFilesModalView.html diff --git a/gui/syncthing/transfer/module.js b/gui/default/syncthing/transfer/module.js similarity index 100% rename from gui/syncthing/transfer/module.js rename to gui/default/syncthing/transfer/module.js diff --git a/gui/syncthing/transfer/neededFilesModalDirective.js b/gui/default/syncthing/transfer/neededFilesModalDirective.js similarity index 100% rename from gui/syncthing/transfer/neededFilesModalDirective.js rename to gui/default/syncthing/transfer/neededFilesModalDirective.js diff --git a/gui/syncthing/transfer/neededFilesModalView.html b/gui/default/syncthing/transfer/neededFilesModalView.html similarity index 100% rename from gui/syncthing/transfer/neededFilesModalView.html rename to gui/default/syncthing/transfer/neededFilesModalView.html diff --git a/gui/syncthing/usagereport/module.js b/gui/default/syncthing/usagereport/module.js similarity index 100% rename from gui/syncthing/usagereport/module.js rename to gui/default/syncthing/usagereport/module.js diff --git a/gui/syncthing/usagereport/usageReportModalDirective.js b/gui/default/syncthing/usagereport/usageReportModalDirective.js similarity index 100% rename from gui/syncthing/usagereport/usageReportModalDirective.js rename to gui/default/syncthing/usagereport/usageReportModalDirective.js diff --git a/gui/syncthing/usagereport/usageReportModalView.html b/gui/default/syncthing/usagereport/usageReportModalView.html similarity index 100% rename from gui/syncthing/usagereport/usageReportModalView.html rename to gui/default/syncthing/usagereport/usageReportModalView.html diff --git a/gui/syncthing/usagereport/usageReportPreviewModalDirective.js b/gui/default/syncthing/usagereport/usageReportPreviewModalDirective.js similarity index 100% rename from gui/syncthing/usagereport/usageReportPreviewModalDirective.js rename to gui/default/syncthing/usagereport/usageReportPreviewModalDirective.js diff --git a/gui/syncthing/usagereport/usageReportPreviewModalView.html b/gui/default/syncthing/usagereport/usageReportPreviewModalView.html similarity index 100% rename from gui/syncthing/usagereport/usageReportPreviewModalView.html rename to gui/default/syncthing/usagereport/usageReportPreviewModalView.html diff --git a/gui/vendor/angular/angular-dirPagination.js b/gui/default/vendor/angular/angular-dirPagination.js similarity index 100% rename from gui/vendor/angular/angular-dirPagination.js rename to gui/default/vendor/angular/angular-dirPagination.js diff --git a/gui/vendor/angular/angular-translate-loader.min.js b/gui/default/vendor/angular/angular-translate-loader.min.js similarity index 100% rename from gui/vendor/angular/angular-translate-loader.min.js rename to gui/default/vendor/angular/angular-translate-loader.min.js diff --git a/gui/vendor/angular/angular-translate.min.js b/gui/default/vendor/angular/angular-translate.min.js similarity index 100% rename from gui/vendor/angular/angular-translate.min.js rename to gui/default/vendor/angular/angular-translate.min.js diff --git a/gui/vendor/angular/angular.min.js b/gui/default/vendor/angular/angular.min.js similarity index 100% rename from gui/vendor/angular/angular.min.js rename to gui/default/vendor/angular/angular.min.js diff --git a/gui/vendor/bootstrap/config.json b/gui/default/vendor/bootstrap/config.json similarity index 100% rename from gui/vendor/bootstrap/config.json rename to gui/default/vendor/bootstrap/config.json diff --git a/gui/vendor/bootstrap/css/bootstrap-theme.css b/gui/default/vendor/bootstrap/css/bootstrap-theme.css similarity index 100% rename from gui/vendor/bootstrap/css/bootstrap-theme.css rename to gui/default/vendor/bootstrap/css/bootstrap-theme.css diff --git a/gui/vendor/bootstrap/css/bootstrap-theme.min.css b/gui/default/vendor/bootstrap/css/bootstrap-theme.min.css similarity index 100% rename from gui/vendor/bootstrap/css/bootstrap-theme.min.css rename to gui/default/vendor/bootstrap/css/bootstrap-theme.min.css diff --git a/gui/vendor/bootstrap/css/bootstrap.css b/gui/default/vendor/bootstrap/css/bootstrap.css similarity index 100% rename from gui/vendor/bootstrap/css/bootstrap.css rename to gui/default/vendor/bootstrap/css/bootstrap.css diff --git a/gui/vendor/bootstrap/css/bootstrap.min.css b/gui/default/vendor/bootstrap/css/bootstrap.min.css similarity index 100% rename from gui/vendor/bootstrap/css/bootstrap.min.css rename to gui/default/vendor/bootstrap/css/bootstrap.min.css diff --git a/gui/vendor/bootstrap/js/bootstrap.js b/gui/default/vendor/bootstrap/js/bootstrap.js similarity index 100% rename from gui/vendor/bootstrap/js/bootstrap.js rename to gui/default/vendor/bootstrap/js/bootstrap.js diff --git a/gui/vendor/bootstrap/js/bootstrap.min.js b/gui/default/vendor/bootstrap/js/bootstrap.min.js similarity index 100% rename from gui/vendor/bootstrap/js/bootstrap.min.js rename to gui/default/vendor/bootstrap/js/bootstrap.min.js diff --git a/gui/vendor/font-awesome/css/font-awesome.min.css b/gui/default/vendor/font-awesome/css/font-awesome.min.css similarity index 100% rename from gui/vendor/font-awesome/css/font-awesome.min.css rename to gui/default/vendor/font-awesome/css/font-awesome.min.css diff --git a/gui/vendor/font-awesome/fonts/FontAwesome.otf b/gui/default/vendor/font-awesome/fonts/FontAwesome.otf similarity index 100% rename from gui/vendor/font-awesome/fonts/FontAwesome.otf rename to gui/default/vendor/font-awesome/fonts/FontAwesome.otf diff --git a/gui/vendor/font-awesome/fonts/fontawesome-webfont.eot b/gui/default/vendor/font-awesome/fonts/fontawesome-webfont.eot similarity index 100% rename from gui/vendor/font-awesome/fonts/fontawesome-webfont.eot rename to gui/default/vendor/font-awesome/fonts/fontawesome-webfont.eot diff --git a/gui/vendor/font-awesome/fonts/fontawesome-webfont.svg b/gui/default/vendor/font-awesome/fonts/fontawesome-webfont.svg similarity index 100% rename from gui/vendor/font-awesome/fonts/fontawesome-webfont.svg rename to gui/default/vendor/font-awesome/fonts/fontawesome-webfont.svg diff --git a/gui/vendor/font-awesome/fonts/fontawesome-webfont.ttf b/gui/default/vendor/font-awesome/fonts/fontawesome-webfont.ttf similarity index 100% rename from gui/vendor/font-awesome/fonts/fontawesome-webfont.ttf rename to gui/default/vendor/font-awesome/fonts/fontawesome-webfont.ttf diff --git a/gui/vendor/font-awesome/fonts/fontawesome-webfont.woff b/gui/default/vendor/font-awesome/fonts/fontawesome-webfont.woff similarity index 100% rename from gui/vendor/font-awesome/fonts/fontawesome-webfont.woff rename to gui/default/vendor/font-awesome/fonts/fontawesome-webfont.woff diff --git a/gui/vendor/font-awesome/fonts/fontawesome-webfont.woff2 b/gui/default/vendor/font-awesome/fonts/fontawesome-webfont.woff2 similarity index 100% rename from gui/vendor/font-awesome/fonts/fontawesome-webfont.woff2 rename to gui/default/vendor/font-awesome/fonts/fontawesome-webfont.woff2 diff --git a/gui/vendor/jquery/jquery-2.0.3.min.js b/gui/default/vendor/jquery/jquery-2.0.3.min.js similarity index 100% rename from gui/vendor/jquery/jquery-2.0.3.min.js rename to gui/default/vendor/jquery/jquery-2.0.3.min.js diff --git a/lib/auto/auto_test.go b/lib/auto/auto_test.go index 91ad35388..1f87527b9 100644 --- a/lib/auto/auto_test.go +++ b/lib/auto/auto_test.go @@ -17,7 +17,7 @@ import ( func TestAssets(t *testing.T) { assets := auto.Assets() - idx, ok := assets["index.html"] + idx, ok := assets["default/index.html"] if !ok { t.Fatal("No index.html in compiled in assets") } diff --git a/lib/config/config.go b/lib/config/config.go index 35854309e..be3b9b024 100644 --- a/lib/config/config.go +++ b/lib/config/config.go @@ -48,6 +48,9 @@ var ( // DefaultDiscoveryServers should be substituted when the configuration // contains default. DefaultDiscoveryServers = append(DefaultDiscoveryServersV4, DefaultDiscoveryServersV6...) + + // DefaultTheme is the default and fallback theme for the web UI. + DefaultTheme = "default" ) func New(myID protocol.DeviceID) Configuration { diff --git a/lib/config/guiconfiguration.go b/lib/config/guiconfiguration.go index 6a300cc00..3cda0eb34 100644 --- a/lib/config/guiconfiguration.go +++ b/lib/config/guiconfiguration.go @@ -20,6 +20,7 @@ type GUIConfiguration struct { RawUseTLS bool `xml:"tls,attr" json:"useTLS"` RawAPIKey string `xml:"apikey,omitempty" json:"apiKey"` InsecureAdminAccess bool `xml:"insecureAdminAccess,omitempty" json:"insecureAdminAccess"` + Theme string `xml:"theme" json:"theme" default:"default"` } func (c GUIConfiguration) Address() string { diff --git a/script/authors.go b/script/authors.go index 13b7f8778..f9c1b0a67 100644 --- a/script/authors.go +++ b/script/authors.go @@ -20,7 +20,7 @@ import ( "strings" ) -const htmlFile = "gui/syncthing/core/aboutModalView.html" +const htmlFile = "gui/default/syncthing/core/aboutModalView.html" func main() { bs := readAll("AUTHORS")