From 51b51bbd0cae2631611b763bd79bf20b3748e553 Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sat, 19 Aug 2023 03:49:58 -0300 Subject: [PATCH 1/7] Update admin.php fixed error when accessing app settings "message":"include(): Failed opening .../partials/license.php' Signed-off-by: Leonardo Lemos --- templates/settings/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/settings/admin.php b/templates/settings/admin.php index 6044067..a62b835 100644 --- a/templates/settings/admin.php +++ b/templates/settings/admin.php @@ -18,7 +18,7 @@ t('You can customize your instance with random background images.')); ?>
t('Here you can specify where random backgrounds should be used by default.')); ?> - inc('partials/license')); ?> + inc('partials/license'.$_['selectedProvider'])); ?>

From dffb849327c5a5b85c43b50bce6ec2c34dfd1479 Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sat, 19 Aug 2023 04:17:18 -0300 Subject: [PATCH 2/7] Update pt_BR.json Signed-off-by: Leonardo Lemos --- l10n/pt_BR.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/l10n/pt_BR.json b/l10n/pt_BR.json index e356dbc..0c9be70 100644 --- a/l10n/pt_BR.json +++ b/l10n/pt_BR.json @@ -1,9 +1,9 @@ { "translations": { "Splash" : "Splash", "under an open license free of charge" : "sob uma licença aberta livre de cobranças.", - "These images are provided %s by %s." : "Essas imagens são fornecidas%s a %s.", + "These images are provided %s by %s." : "Essas imagens são fornecidas %s a %s.", "under the terms of service" : "Sob os termos de serviço", - "These images are provided by %s. Each image has it's own license." : "Essas imagens são fornecidas a%s. Cada imagem tem sua própria licença.", + "These images are provided by %s. Each image has it's own license." : "Essas imagens são fornecidas a %s. Cada imagem tem sua própria licença.", "Splash: Random Background Images" : "Splash: Imagens de fundo aleatórias", "Saved" : "Salvo", "Failed" : "Falhou", @@ -17,13 +17,13 @@ "Splash: Advanced Theming" : "Splash: Configurações avançadas de tema", "You can apply effects to your background images." : "Você pode aplicar efeitos para as imagens de fundo.", "Enable Tint" : "Ativar Matiz", - "Set the vibrancy of the color" : "Configurar vibração da cor", + "Set the vibrancy of the color" : "Configurar a vivacidade da cor", "Set the blur of the image" : "Defina o desfoque da imagem", "Splash: High Visibility" : "Destaque: alta visibilidade", - "You can enable a High Visibility Mode for Legal Reasons. This will highlight the Privacy and Data Protection links on the login screen." : "You can enable a High Visibility Mode for Legal Reasons. This will highlight the Privacy and Data Protection links on the login screen.", + "You can enable a High Visibility Mode for Legal Reasons. This will highlight the Privacy and Data Protection links on the login screen." : "Você pode habilitar um modo de alta visibilidade por razões legais. Isso destacará os links Privacidade e Proteção de Dados na tela de login.", "Enable High-Visibility Mode" : "Ativar modo de Alta Visibilidade", "Random Background Images" : "Imagens aleatórias para plano de fundo", - "%s is customized with random background images." : "%sestá customizado com imagens aleatórias de fundo", + "%s is customized with random background images." : "% sestá customizado com imagens aleatórias de fundo", "The images will be displayed as the background if you choose \"Default Image\" as your background." : "As imagens serão exibidas como plano de fundo se você escolher \"Imagem padrão\" como plano de fundo." },"pluralForm" :"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" -} \ No newline at end of file +} From 787fa7964489b7d7a826c3ef87faff9005c9f184 Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sat, 19 Aug 2023 04:25:07 -0300 Subject: [PATCH 3/7] Update pt_BR.js Signed-off-by: Leonardo Lemos --- l10n/pt_BR.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/l10n/pt_BR.js b/l10n/pt_BR.js index c4b12a2..0c23a66 100644 --- a/l10n/pt_BR.js +++ b/l10n/pt_BR.js @@ -3,9 +3,9 @@ OC.L10N.register( { "Splash" : "Splash", "under an open license free of charge" : "sob uma licença aberta livre de cobranças.", - "These images are provided %s by %s." : "Essas imagens são fornecidas%s a %s.", + "These images are provided %s by %s." : "Essas imagens são fornecidas %s a %s.", "under the terms of service" : "Sob os termos de serviço", - "These images are provided by %s. Each image has it's own license." : "Essas imagens são fornecidas a%s. Cada imagem tem sua própria licença.", + "These images are provided by %s. Each image has it's own license." : "Essas imagens são fornecidas a %s. Cada imagem tem sua própria licença.", "Splash: Random Background Images" : "Splash: Imagens de fundo aleatórias", "Saved" : "Salvo", "Failed" : "Falhou", @@ -19,13 +19,13 @@ OC.L10N.register( "Splash: Advanced Theming" : "Splash: Configurações avançadas de tema", "You can apply effects to your background images." : "Você pode aplicar efeitos para as imagens de fundo.", "Enable Tint" : "Ativar Matiz", - "Set the vibrancy of the color" : "Configurar vibração da cor", + "Set the vibrancy of the color" : "Configurar a vivacidade da cor", "Set the blur of the image" : "Defina o desfoque da imagem", "Splash: High Visibility" : "Destaque: alta visibilidade", - "You can enable a High Visibility Mode for Legal Reasons. This will highlight the Privacy and Data Protection links on the login screen." : "You can enable a High Visibility Mode for Legal Reasons. This will highlight the Privacy and Data Protection links on the login screen.", + "You can enable a High Visibility Mode for Legal Reasons. This will highlight the Privacy and Data Protection links on the login screen." : "Você pode habilitar um modo de alta visibilidade por razões legais. Isso destacará os links Privacidade e Proteção de Dados na tela de login.", "Enable High-Visibility Mode" : "Ativar modo de Alta Visibilidade", "Random Background Images" : "Imagens aleatórias para plano de fundo", - "%s is customized with random background images." : "%sestá customizado com imagens aleatórias de fundo", + "%s is customized with random background images." : "% sestá customizado com imagens aleatórias de fundo", "The images will be displayed as the background if you choose \"Default Image\" as your background." : "As imagens serão exibidas como plano de fundo se você escolher \"Imagem padrão\" como plano de fundo." }, "nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); From 629d863e7904e711c7b4e51b6f5bdfd65229eddf Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sat, 19 Aug 2023 04:27:34 -0300 Subject: [PATCH 4/7] Create user.js Signed-off-by: Leonardo Lemos --- js/user.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 js/user.js diff --git a/js/user.js b/js/user.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/js/user.js @@ -0,0 +1 @@ + From 5257b87ef0da6a3200baf4ffa947c093f8db6329 Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sat, 19 Aug 2023 04:27:58 -0300 Subject: [PATCH 5/7] Update user.js Signed-off-by: Leonardo Lemos --- js/user.js | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/js/user.js b/js/user.js index 8b13789..7bffa89 100644 --- a/js/user.js +++ b/js/user.js @@ -1 +1,132 @@ +(function() { + function initialize() { + this._timer = []; + this.saveUrl = document.getElementById('unsplash-settings').dataset.save; + let customizationInputText = document.getElementById('splash-provider-customization'); + customizationInputText.onkeydown = function(e){ + if (e.keyCode === 13) { + let key = e.target.dataset.setting, + value = e.target.value, + type = e.target.getAttribute('type'); + _setValue(key, value, type); + e.preventDefault(); + } + return true; + }; + + + let settings = document.querySelectorAll('[data-setting]'); + for(let setting of settings) { + setting.addEventListener( + 'change', + (e) => { + let key = e.target.dataset.setting, + value = e.target.value, + type = e.target.getAttribute('type'); + + if(type === 'checkbox') { + value = e.target.checked ? 'true':'false'; + } + + if(type === 'select') { + value = e.target.value; + } + + if(key === 'style/tint') { + let enable = false + if(value === "true"){ + enable = true + } + document.getElementById('unsplash-style-color-strength').disabled = !enable; + } + + _setValue(key, value, type); + } + ); + } + } + + /** + * Update configuration value + * + * @param key + * @param value + * @private + */ + function _setValue(key, value, type) { + let headers = new Headers(); + headers.append('requesttoken', OC.requestToken); + headers.append('Accept', 'application/json'); + headers.append('Content-Type', 'application/json'); + + let body = JSON.stringify({key, value}), + options = {headers, body, method: 'POST', redirect: 'error'}, + request = new Request(this.saveUrl, options); + + fetch(request) + .then(() => { + _showMessage('success'); + if(type === 'select') { + getCustomization(value) + } + }) + .catch((e) => { + console.error(e); + _showMessage('error'); + }); + } + + /** + * Update configuration value + * + * @param key + * @param value + * @private + */ + function getCustomization(providername) { + let headers = new Headers(); + headers.append('requesttoken', OC.requestToken); + headers.append('Accept', 'application/json'); + headers.append('Content-Type', 'application/json'); + + let updateCustomizationUrl = document.getElementById('unsplash-settings').dataset.requestupdate + + //todo: build this url better. + var apiUrl = updateCustomizationUrl.substr(0,updateCustomizationUrl.lastIndexOf("/")+1); + let options = {headers, method: 'GET', redirect: 'error'}, + request = new Request(apiUrl+providername, options); + + fetch(request) + .then(res => + res.json()) + .then(data => { + document.getElementById('splash-provider-customization').value = data['customization']; + }) + .then(() => { + _showMessage('success'); + }) + .catch((e) => { + console.error(e); + _showMessage('error'); + }); + } + + /** + * Show save success/fail message + * + * @param type + * @private + */ + function _showMessage(type) { + let element = document.querySelector(`#unsplash-settings .msg.${type}`); + + element.classList.remove('active'); + element.classList.add('active'); + + clearTimeout(this._timer[type]); + this._timer[type] = setTimeout(() => { element.classList.remove('active'); }, 1000); + } + + initialize(); +})(); From 98497232e06e6f15c34bbcaf411c36158fec84c6 Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sat, 19 Aug 2023 04:40:19 -0300 Subject: [PATCH 6/7] Update user.js Signed-off-by: Leonardo Lemos --- js/user.js | 131 ----------------------------------------------------- 1 file changed, 131 deletions(-) diff --git a/js/user.js b/js/user.js index 7bffa89..8b13789 100644 --- a/js/user.js +++ b/js/user.js @@ -1,132 +1 @@ -(function() { - function initialize() { - this._timer = []; - this.saveUrl = document.getElementById('unsplash-settings').dataset.save; - let customizationInputText = document.getElementById('splash-provider-customization'); - customizationInputText.onkeydown = function(e){ - if (e.keyCode === 13) { - let key = e.target.dataset.setting, - value = e.target.value, - type = e.target.getAttribute('type'); - _setValue(key, value, type); - e.preventDefault(); - } - return true; - }; - - - let settings = document.querySelectorAll('[data-setting]'); - for(let setting of settings) { - setting.addEventListener( - 'change', - (e) => { - let key = e.target.dataset.setting, - value = e.target.value, - type = e.target.getAttribute('type'); - - if(type === 'checkbox') { - value = e.target.checked ? 'true':'false'; - } - - if(type === 'select') { - value = e.target.value; - } - - if(key === 'style/tint') { - let enable = false - if(value === "true"){ - enable = true - } - document.getElementById('unsplash-style-color-strength').disabled = !enable; - } - - _setValue(key, value, type); - } - ); - } - } - - /** - * Update configuration value - * - * @param key - * @param value - * @private - */ - function _setValue(key, value, type) { - let headers = new Headers(); - headers.append('requesttoken', OC.requestToken); - headers.append('Accept', 'application/json'); - headers.append('Content-Type', 'application/json'); - - let body = JSON.stringify({key, value}), - options = {headers, body, method: 'POST', redirect: 'error'}, - request = new Request(this.saveUrl, options); - - fetch(request) - .then(() => { - _showMessage('success'); - if(type === 'select') { - getCustomization(value) - } - }) - .catch((e) => { - console.error(e); - _showMessage('error'); - }); - } - - /** - * Update configuration value - * - * @param key - * @param value - * @private - */ - function getCustomization(providername) { - let headers = new Headers(); - headers.append('requesttoken', OC.requestToken); - headers.append('Accept', 'application/json'); - headers.append('Content-Type', 'application/json'); - - let updateCustomizationUrl = document.getElementById('unsplash-settings').dataset.requestupdate - - //todo: build this url better. - var apiUrl = updateCustomizationUrl.substr(0,updateCustomizationUrl.lastIndexOf("/")+1); - let options = {headers, method: 'GET', redirect: 'error'}, - request = new Request(apiUrl+providername, options); - - fetch(request) - .then(res => - res.json()) - .then(data => { - document.getElementById('splash-provider-customization').value = data['customization']; - }) - .then(() => { - _showMessage('success'); - }) - .catch((e) => { - console.error(e); - _showMessage('error'); - }); - } - - /** - * Show save success/fail message - * - * @param type - * @private - */ - function _showMessage(type) { - let element = document.querySelector(`#unsplash-settings .msg.${type}`); - - element.classList.remove('active'); - element.classList.add('active'); - - clearTimeout(this._timer[type]); - this._timer[type] = setTimeout(() => { element.classList.remove('active'); }, 1000); - } - - initialize(); -})(); From eda414819af7cfa5f44ac21e75608741447d0dfc Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sat, 19 Aug 2023 04:47:30 -0300 Subject: [PATCH 7/7] Update personal.php commented out line 10 script('unsplash', 'user'); preventing error when accessing the user's theme settings Signed-off-by: Leonardo Lemos --- templates/settings/personal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/settings/personal.php b/templates/settings/personal.php index 30f4ddb..b9deb16 100644 --- a/templates/settings/personal.php +++ b/templates/settings/personal.php @@ -7,7 +7,7 @@ if( ($_['dashboard'] || $_['login']) && ($_['selectedProvider'] != "" || $_['selectedProvider'] != "Nextcloud Image") ): - script('unsplash', 'user'); +/** script('unsplash', 'user'); */ style('unsplash', 'settings'); ?>