mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Merge branch 'staging' into update-broadcast
This commit is contained in:
commit
f24037b2f1
@ -19,6 +19,10 @@
|
||||
* prompt premium users to cancel their subscriptions before deleting their accounts
|
||||
* check that headers for XLSX export are correctly set via the checkup app
|
||||
* guard against some type errors in the support page
|
||||
* remove default privacy policy
|
||||
* remove HTML from most translations
|
||||
* localize links to the docs where a translation exists
|
||||
* remove redundant link from OpenCollective popup
|
||||
|
||||
# 4.3.1
|
||||
|
||||
|
||||
@ -12,9 +12,6 @@ define([
|
||||
return e;
|
||||
};
|
||||
|
||||
// TODO make a docsLink function which wraps this
|
||||
// and points to the appropriate translation:
|
||||
// French, German, or English as a default
|
||||
Pages.externalLink = function (el, href) {
|
||||
if (!el) { return el; }
|
||||
el.setAttribute("rel", "noopener noreferrer");
|
||||
@ -25,6 +22,26 @@ define([
|
||||
return el;
|
||||
};
|
||||
|
||||
// this rewrites URLS to point to the appropriate translation:
|
||||
// French, German, or English as a default
|
||||
var documentedLanguages = ['en', 'fr', 'de'];
|
||||
Pages.localizeDocsLink = function (href) {
|
||||
try {
|
||||
var lang = Msg._getLanguage();
|
||||
if (documentedLanguages.indexOf(lang) > 0) {
|
||||
return href.replace('/en/', '/' + lang + '/');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
// if it fails just use the default href (English)
|
||||
}
|
||||
return href;
|
||||
};
|
||||
|
||||
Pages.documentationLink = function (el, href) {
|
||||
return Pages.externalLink(el, Pages.localizeDocsLink(href));
|
||||
};
|
||||
|
||||
var languageSelector = function () {
|
||||
var options = [];
|
||||
var languages = Msg._languages;
|
||||
|
||||
@ -81,7 +81,7 @@ define([
|
||||
}
|
||||
|
||||
var supportText = Pages.setHTML(h('span'), Msg.home_support);
|
||||
Pages.externalLink(supportText.querySelector('a'), "https://docs.cryptpad.fr/en/how_to_contribute.html");
|
||||
Pages.documentationLink(supportText.querySelector('a'), "https://docs.cryptpad.fr/en/how_to_contribute.html");
|
||||
|
||||
var opensource = Pages.setHTML(h('p'), Msg.home_opensource);
|
||||
Pages.externalLink(opensource.querySelector('a'), "https://github.com/xwiki-labs/cryptpad");
|
||||
|
||||
@ -370,7 +370,7 @@ define([
|
||||
h('div.cp-teams-invite-block', [
|
||||
h('span', Messages.team_inviteLinkSetPassword),
|
||||
h('a.cp-teams-help.fa.fa-question-circle', {
|
||||
href: origin + 'https://docs.cryptpad.fr/en/user_guide/security.html#passwords-for-documents-and-folders',
|
||||
href: origin + Pages.localizeDocsLink('https://docs.cryptpad.fr/en/user_guide/security.html#passwords-for-documents-and-folders'),
|
||||
target: "_blank",
|
||||
'data-tippy-placement': "right"
|
||||
})
|
||||
@ -1112,6 +1112,7 @@ define([
|
||||
if (apps[type]) {
|
||||
href = "https://docs.cryptpad.fr/en/user_guide/apps/" + apps[type] + ".html";
|
||||
}
|
||||
href = Pages.localizeDocsLink(href);
|
||||
|
||||
var content = setHTML(h('p'), Messages.help_genericMore);
|
||||
$(content).find('a').attr({
|
||||
@ -2167,7 +2168,7 @@ define([
|
||||
UI.getFileIcon({type: type})[0],
|
||||
h('div.cp-creation-title-text', [
|
||||
h('span', newPadH3Title),
|
||||
createHelper('https://docs.cryptpad.fr/en/user_guide/apps/general.html#new-document', Messages.creation_helperText)
|
||||
createHelper(Pages.localizeDocsLink('https://docs.cryptpad.fr/en/user_guide/apps/general.html#new-document'), Messages.creation_helperText)
|
||||
])
|
||||
]);
|
||||
$creation.append(title);
|
||||
|
||||
@ -19,6 +19,7 @@ define([
|
||||
'/common/proxy-manager.js',
|
||||
'/customize/application_config.js',
|
||||
'/customize/messages.js',
|
||||
'/customize/pages.js',
|
||||
], function (
|
||||
$,
|
||||
ApiConfig,
|
||||
@ -37,7 +38,8 @@ define([
|
||||
h,
|
||||
ProxyManager,
|
||||
AppConfig,
|
||||
Messages)
|
||||
Messages,
|
||||
Pages)
|
||||
{
|
||||
|
||||
var APP = window.APP = {
|
||||
@ -2490,7 +2492,7 @@ define([
|
||||
// Get the upload options
|
||||
var addSharedFolderModal = function (cb) {
|
||||
|
||||
var docsHref = common.getBounceURL("https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners");
|
||||
var docsHref = common.getBounceURL(Pages.localizeDocsLink("https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners"));
|
||||
|
||||
// Ask for name, password and owner
|
||||
var content = h('div', [
|
||||
@ -2503,7 +2505,7 @@ define([
|
||||
style: 'display:flex;align-items:center;justify-content:space-between'
|
||||
}, [
|
||||
UI.createCheckbox('cp-app-drive-sf-owned', Messages.sharedFolders_create_owned, true),
|
||||
UI.createHelper(docsHref, Messages.creation_owned1) // TODO
|
||||
UI.createHelper(docsHref, Messages.creation_owned1)
|
||||
]),
|
||||
]);
|
||||
|
||||
@ -4393,7 +4395,7 @@ define([
|
||||
style: 'display:flex;align-items:center;justify-content:space-between'
|
||||
}, [
|
||||
UI.createCheckbox('cp-upload-owned', Messages.sharedFolders_create_owned, true),
|
||||
UI.createHelper('https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners', Messages.creation_owned1)
|
||||
UI.createHelper(Pages.localizeDocsLink('https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners'), Messages.creation_owned1)
|
||||
]),
|
||||
]);
|
||||
return void UI.confirm(convertContent, function(res) {
|
||||
|
||||
@ -10,8 +10,9 @@ define([
|
||||
'/common/clipboard.js',
|
||||
'/customize/messages.js',
|
||||
'/bower_components/nthen/index.js',
|
||||
'/customize/pages.js',
|
||||
], function ($, Util, Hash, UI, UIElements, Feedback, Modal, h, Clipboard,
|
||||
Messages, nThen) {
|
||||
Messages, nThen, Pages) {
|
||||
var Share = {};
|
||||
|
||||
var createShareWithFriends = function (config, onShare, linkGetter) {
|
||||
@ -252,7 +253,7 @@ define([
|
||||
h('a', {href: '#'}, Messages.passwordFaqLink)
|
||||
]);
|
||||
$(link).click(function () {
|
||||
opts.common.openUnsafeURL("https://docs.cryptpad.fr/en/user_guide/security.html#passwords-for-documents-and-folders");
|
||||
opts.common.openUnsafeURL(Pages.localizeDocsLink("https://docs.cryptpad.fr/en/user_guide/security.html#passwords-for-documents-and-folders"));
|
||||
});
|
||||
return link;
|
||||
};
|
||||
|
||||
@ -10,10 +10,11 @@ define([
|
||||
'/common/common-hash.js',
|
||||
'/common/hyperscript.js',
|
||||
'/customize/messages.js',
|
||||
'/customize/pages.js',
|
||||
|
||||
'/bower_components/file-saver/FileSaver.min.js',
|
||||
'/bower_components/tweetnacl/nacl-fast.min.js',
|
||||
], function ($, ApiConfig, FileCrypto, MakeBackup, Thumb, UI, UIElements, Util, Hash, h, Messages) {
|
||||
], function ($, ApiConfig, FileCrypto, MakeBackup, Thumb, UI, UIElements, Util, Hash, h, Messages, Pages) {
|
||||
var Nacl = window.nacl;
|
||||
var module = {};
|
||||
|
||||
@ -327,7 +328,7 @@ define([
|
||||
style: 'display:flex;align-items:center;justify-content:space-between'
|
||||
}, [
|
||||
UI.createCheckbox('cp-upload-owned', Messages.upload_modal_owner, modalState.owned),
|
||||
createHelper('https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners', Messages.creation_owned1)
|
||||
createHelper(Pages.localizeDocsLink('https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners'), Messages.creation_owned1)
|
||||
]),
|
||||
manualStore
|
||||
]);
|
||||
@ -382,7 +383,7 @@ define([
|
||||
style: 'display:flex;align-items:center;justify-content:space-between'
|
||||
}, [
|
||||
UI.createCheckbox('cp-upload-owned', Messages.uploadFolder_modal_owner, modalState.owned),
|
||||
createHelper('https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners', Messages.creation_owned1)
|
||||
createHelper(Pages.localizeDocsLink('https://docs.cryptpad.fr/en/user_guide/share_and_access.html#owners'), Messages.creation_owned1)
|
||||
]),
|
||||
manualStore
|
||||
]);
|
||||
|
||||
@ -781,7 +781,7 @@ define([
|
||||
if (i) { i.classList = 'fa fa-shhare-alt'; }
|
||||
var a = error.querySelector('a');
|
||||
if (a) {
|
||||
a.setAttribute('href', "https://docs.cryptpad.fr/en/user_guide/user_account.html#confidentiality");
|
||||
a.setAttribute('href', Pages.localizeDocsLink("https://docs.cryptpad.fr/en/user_guide/user_account.html#confidentiality"));
|
||||
}
|
||||
UI.errorLoadingScreen(error);
|
||||
});
|
||||
|
||||
@ -1188,5 +1188,16 @@
|
||||
"broadcast_surveyURL": "Link zur Umfrage",
|
||||
"admin_surveyActive": "Umfrage öffnen",
|
||||
"admin_surveyCancel": "Entfernen",
|
||||
"admin_surveyButton": "Umfrage speichern"
|
||||
"admin_surveyButton": "Umfrage speichern",
|
||||
"broadcast_defaultLanguage": "Standardmäßig diese Sprache verwenden",
|
||||
"admin_broadcastTitle": "Mitteilung",
|
||||
"admin_cat_broadcast": "Ankündigungen",
|
||||
"admin_surveyHint": "Eine externe Umfrage hinzufügen, ändern oder löschen. Die Benutzer werden eine Benachrichtigung erhalten und die Umfrage bleibt über das Benutzermenü verfügbar.",
|
||||
"admin_maintenanceHint": "Plane Wartungsarbeiten auf dieser Instanz und benachrichtige alle Benutzer. Es kann maximal eine aktive Wartung geben.",
|
||||
"broadcast_newCustom": "Mitteilung der Administratoren",
|
||||
"admin_broadcastCancel": "Mitteilung löschen",
|
||||
"admin_broadcastActive": "Aktive Mitteilung",
|
||||
"admin_broadcastHint": "Sende eine Mitteilung an alle Benutzer auf dieser Instanz. Alle existierenden und neue Benutzer werden sie als Benachrichtigung erhalten. Du kannst sie mit **Vorschau der Benachrichtigung** überprüfen. Die Vorschau ist mit einem roten Symbol gekennzeichnet und nur für dich sichtbar.",
|
||||
"broadcast_preview": "Vorschau der Benachrichtigung",
|
||||
"admin_maintenanceCancel": "Wartungsarbeiten stornieren"
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ define([
|
||||
create['form'] = function () {
|
||||
var key = 'form';
|
||||
var $div = makeBlock(key, true); // Msg.support_formHint, .support_formTitle, .support_formButton
|
||||
Pages.externalLink($div.find('a')[0], 'https://docs.cryptpad.fr/en/user_guide/index.html');
|
||||
Pages.documentationLink($div.find('a')[0], 'https://docs.cryptpad.fr/en/user_guide/index.html');
|
||||
|
||||
var form = APP.support.makeForm();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user