Skip to content

Commit

Permalink
Use WazeWrap to add layer checkbox
Browse files Browse the repository at this point in the history
This fixes WMEValidator#59
The layer is added to the layer selection and toggles with the shortcut
  • Loading branch information
davidakachaos committed Nov 5, 2018
1 parent a807f6a commit 5b29e66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meta/wme-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ var WazeWrap = {
Interface: {
Shortcut: {
add: function () { },
}
},
AddLayerCheckbox: function(group, checkboxText, checked, callback) { },
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,9 @@ function F_LOGIN() {
// Create Shortcut
new WazeWrap.Interface.Shortcut(GL_LAYERACCEL, 'Toggle WME Validator',
'wmevalidator', 'WME Validator', GL_LAYERSHORTCUT, onToggleValidator, null).add();

new WazeWrap.Interface.AddLayerCheckbox("issues", GL_LAYERNAME, _UI.pSettings.pScanner.oHLReported.CHECKED, onToggleValidator)

// append user interface after the details or ad the bottom
_THUI.appendUI(document.getElementById("sidepanel-" + ID_PREFIX),
_UI, "i" + ID_PREFIX);
Expand Down
4 changes: 4 additions & 0 deletions src/other.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,11 +983,15 @@ function F_UPDATEUI(e) {
if (_UI.pSettings.pScanner.oHLReported.CHECKED) {
ForceHLAllSegments();
_RT.$HLlayer.setVisibility(true);
// Check the layer in layer switcher
$('#layer-switcher-item_wme_validator').prop('checked', true);
}
else {
ForceHLAllSegments();
destroyHLs();
_RT.$HLlayer.setVisibility(false);
// Uncheck the layer in layer switcher
$('#layer-switcher-item_wme_validator').prop('checked', false);
}
_RT.$switchValidator = false;
}
Expand Down

0 comments on commit 5b29e66

Please sign in to comment.