Skip to content

Commit

Permalink
Merge pull request #573 from wikitree/and_in_example
Browse files Browse the repository at this point in the history
Usability Tweaks: "and" between parents in example wiki code
  • Loading branch information
shogenapps committed Jun 9, 2024
2 parents 280396f + fa4cb95 commit bcb9e34
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/features/usability_tweaks/usability_tweaks.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,18 @@ shouldInitializeFeature("usabilityTweaks").then((result) => {
}

// Open Add/Remove/Replace links in the same tab
if (isProfileEdit && options.removeTargetsFromEditFamilyLinks) {
$("a[href*='&who=']").attr("target", "_self");
if (isProfileEdit) {
if (options.removeTargetsFromEditFamilyLinks) {
$("a[href*='&who=']").attr("target", "_self");
}

if (options.andBetweenParentsExample) {
//insert and between the parents in the example
var allExamples = document.getElementsByClassName("EXAMPLE");
if (allExamples[2].innerHTML != null && allExamples[2].innerHTML.search(/\]\] \[\[/) > -1) {
allExamples[2].innerText = allExamples[2].innerHTML.replace("]] [[", "]] and [[").trim();
}
}
}

// Replace Add/Remove/Replace links with Add, Remove, Connect links
Expand Down
6 changes: 6 additions & 0 deletions src/features/usability_tweaks/usability_tweaks_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ const usabilityTweaks = {
type: OptionType.GROUP,
label: "Profile edit page",
options: [
{
id: "andBetweenParentsExample",
type: OptionType.CHECKBOX,
label: "Insert 'and' between the parents in the wiki code example.",
defaultValue: true,
},
{
id: "removeTargetsFromEditFamilyLinks",
type: OptionType.CHECKBOX,
Expand Down

0 comments on commit bcb9e34

Please sign in to comment.