Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ @media screen and (max-width: 1090px) and (min-width: 650.01px) {{
new H4(translation.linkOption),
translation.Selectables.Select(sel => new DIV(
new INPUT { type = itype.radio, class_ = "set-selectable", name = "selectable", id = $"selectable-{sel.PropName}" }.Data("selectable", sel.PropName), " ",
new LABEL { class_ = "set-selectable", id = $"selectable-label-{sel.PropName}", for_ = $"selectable-{sel.PropName}", accesskey = sel.Accel?.ToString().ToLowerInvariant() }._(sel.HumanReadable.Accel(sel.Accel))))),
new LABEL { class_ = "set-selectable", id = $"selectable-label-{sel.PropName}", for_ = $"selectable-{sel.PropName}", accesskey = sel.Accel?.ToString().ToLowerInvariant() }._(sel.HumanReadable.Accel(sel.Accel)))),
new INPUT { type = itype.checkbox, class_= "set-new-tab", id = "set-new-tab"},
new LABEL {for_ = "set-new-tab"}._(translation.newTab)
),
new DIV { class_ = "option-group" }._(new H4(translation.languagesOption), new DIV { id = "languages-option" }),
new BUTTON { class_ = "toggle-all-languages" }._(translation.languagesToggle)),

Expand Down
14 changes: 13 additions & 1 deletion Resources/KtaneWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function initializePage(modules, initIcons, initDocDirs, initFilters, initSelect
try { filter = JSON.parse(lStorage.getItem('filters') || '{}') || {}; }
catch (exc) { }
let selectable = lStorage.getItem('selectable') || 'manual';
let currentTarget = lStorage.getItem('currentTarget') || '_self';
if (initSelectables.map(sel => sel.PropName).indexOf(selectable) === -1)
selectable = 'manual';
let preferredManuals = {};
Expand Down Expand Up @@ -1605,8 +1606,19 @@ function initializePage(modules, initIcons, initDocDirs, initFilters, initSelect

// This also calls updateFilter()
setSelectable(selectable);

$('input.set-selectable').click(function() { setSelectable($(this).data('selectable')); });
$('input.set-new-tab').change(function(event){
currentTarget = event.target.checked?"_blank":"_self";
lStorage.setItem('currentTarget', currentTarget);
for (let el of document.getElementsByClassName("modlink")){
el.setAttribute('target', currentTarget);
}
});
$('input.set-new-tab')[0].checked = (lStorage.getItem('currentTarget') === "_blank");
for (let el of document.getElementsByClassName("modlink")){
el.setAttribute('target', currentTarget);
}
$('input.filter').click(function() { updateFilter(); });
$("input.results-mode").click(function() { setResultsMode(this.value, resultsLimit); });
$("input#results-limit").change(function() { setResultsMode(resultsMode, this.value | 0); });
Expand Down
1 change: 1 addition & 0 deletions TranslationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ private static TranslationInfo makeDefault()
public string selectableSource = "Source code";
public string selectableSourceClone = "Source code (clone)";
public string selectableTutorial = "Tutorial videos";
public string newTab = "Always open in new tab";
public string displayOption = "Display";
public string displayOriginalName = "Original name";
public string displayOriginalNameTooltip = "Displays the original (English-language) name in addition to the translated name.";
Expand Down