Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
metager-webextension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
metager-webextension
Commits
222dcb27
Commit
222dcb27
authored
9 months ago
by
Dominik Hebeler
Browse files
Options
Downloads
Plain Diff
Merge branch '3-broken-link-to-anonymous-token' into 'master'
Resolve "Broken link to anonymous token" Closes
#3
See merge request
!6
parents
c712d9ec
9b0c002c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Resolve "Broken link to anonymous token"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
web/settings/index.html
+2
-1
2 additions, 1 deletion
web/settings/index.html
web/settings/strings.js
+24
-2
24 additions, 2 deletions
web/settings/strings.js
with
30 additions
and
3 deletions
CHANGELOG.md
0 → 100644
+
4
−
0
View file @
222dcb27
# v0.1.0.3
*
Fix: Broken link to help page for homomorphic encryption
*
Feature: Better localized links to MetaGer pages
\ No newline at end of file
This diff is collapsed.
Click to expand it.
web/settings/index.html
+
2
−
1
View file @
222dcb27
...
...
@@ -32,7 +32,8 @@
</label>
</div>
<div
class=
"description"
>
<div
data-text=
"settings_anonymous_tokens_description"
>
<div
data-text=
"settings_anonymous_tokens_description"
data-replacements=
"https://metager.org/keys/help/anonymous-token"
>
</div>
<div
class=
"status hidden"
>
<div
class=
"key"
>
...
...
This diff is collapsed.
Click to expand it.
web/settings/strings.js
+
24
−
2
View file @
222dcb27
let
default_domain
=
"
https://metager.org
"
;
let
localized_domain
=
chrome
.
i18n
.
getUILanguage
()
==
"
de
"
?
"
https://metager.de
"
:
"
https://metager.org
"
;
// Inserts localized strings into html elements
document
.
querySelectorAll
(
"
[data-text]
"
).
forEach
(
element
=>
{
let
key
=
element
.
dataset
.
text
;
let
message
=
chrome
.
i18n
.
getMessage
(
key
);
// Check for replacements
let
replacements
=
element
.
dataset
.
replacements
;
if
(
replacements
)
{
replacements
=
replacements
.
split
(
"
|
"
);
for
(
let
i
=
0
;
i
<
replacements
.
length
;
i
++
)
{
// Check for base domain in strings
if
(
replacements
[
i
].
indexOf
(
default_domain
)
==
0
)
{
replacements
[
i
]
=
replacements
[
i
].
replace
(
default_domain
,
localized_domain
);
}
}
}
let
message
=
chrome
.
i18n
.
getMessage
(
key
,
replacements
);
if
(
message
)
element
.
innerHTML
=
message
;
})
\ No newline at end of file
});
// Localize the target domain for our links
document
.
querySelectorAll
(
"
a
"
).
forEach
(
element
=>
{
if
(
element
.
href
.
indexOf
(
default_domain
)
==
0
)
{
element
.
href
=
element
.
href
.
replace
(
default_domain
,
localized_domain
);
}
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment