Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Haertl <jus@bitgrid.net>2016-08-24 12:33:54 +0300
committerJulius Haertl <jus@bitgrid.net>2016-08-26 13:08:12 +0300
commitd95aec2ed2a8a6f9afe169e828d1bbeb0a316618 (patch)
tree5aa321c982c465f0f538665835dc99c9eebc1eb6 /apps/theming/js
parent044d7c3bb71b24a140bdf6581779a16474b0e490 (diff)
Theming: Add preview for login screen
Diffstat (limited to 'apps/theming/js')
-rw-r--r--apps/theming/js/settings-admin.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js
index 01ff9123842..a18874941e8 100644
--- a/apps/theming/js/settings-admin.js
+++ b/apps/theming/js/settings-admin.js
@@ -68,7 +68,7 @@ function preview(setting, value) {
textColor = "#ffffff";
icon = 'caret';
}
- if (luminance>0.8) {
+ if (luminance > 0.8) {
elementColor = '#555555';
}
@@ -87,16 +87,27 @@ function preview(setting, value) {
'background-image: url(\'data:image/svg+xml;base64,' + generateRadioButton(elementColor) + '\'); }'
);
}
+
+ var timestamp = new Date().getTime();
if (setting === 'logoMime') {
- console.log(setting);
var logos = document.getElementsByClassName('logo-icon');
- var timestamp = new Date().getTime();
+ var previewImageLogo = document.getElementById('theming-preview-logo');
if (value !== '') {
logos[0].style.backgroundImage = "url('" + OC.generateUrl('/apps/theming/logo') + "?v" + timestamp + "')";
logos[0].style.backgroundSize = "contain";
+ previewImageLogo.src = OC.generateUrl('/apps/theming/logo') + "?v" + timestamp;
} else {
- logos[0].style.backgroundImage = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp +"')";
+ logos[0].style.backgroundImage = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp + "')";
logos[0].style.backgroundSize = "contain";
+ previewImageLogo.src = OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp;
+ }
+ }
+ if (setting === 'backgroundMime') {
+ var previewImage = document.getElementById('theming-preview');
+ if (value !== '') {
+ previewImage.style.backgroundImage = "url('" + OC.generateUrl('/apps/theming/loginbackground') + "?v" + timestamp + "')";
+ } else {
+ previewImage.style.backgroundImage = "url('" + OC.getRootPath() + '/core/img/background.jpg?v' + timestamp + "')";
}
}
}