on/off button for entering/leaving protected session has been changed to literal buttons

This commit is contained in:
azivner 2018-11-25 14:12:33 +01:00
parent 196e8b4380
commit 62dbd4062a
3 changed files with 16 additions and 13 deletions

View File

@ -43,8 +43,8 @@ function registerEntrypoints() {
$("#recent-changes-button").click(recentChangesDialog.showDialog); $("#recent-changes-button").click(recentChangesDialog.showDialog);
$("#protected-session-on").click(protectedSessionService.enterProtectedSession); $("#enter-protected-session-button").click(protectedSessionService.enterProtectedSession);
$("#protected-session-off").click(protectedSessionService.leaveProtectedSession); $("#leave-protected-session-button").click(protectedSessionService.leaveProtectedSession);
$("#toggle-search-button").click(searchNotesService.toggleSearch); $("#toggle-search-button").click(searchNotesService.toggleSearch);
utils.bindShortcut('ctrl+s', searchNotesService.toggleSearch); utils.bindShortcut('ctrl+s', searchNotesService.toggleSearch);

View File

@ -11,8 +11,8 @@ const $password = $("#protected-session-password");
const $noteDetailWrapper = $("#note-detail-wrapper"); const $noteDetailWrapper = $("#note-detail-wrapper");
const $protectButton = $("#protect-button"); const $protectButton = $("#protect-button");
const $unprotectButton = $("#unprotect-button"); const $unprotectButton = $("#unprotect-button");
const $protectedSessionOnButton = $("#protected-session-on"); const $enterProtectedSessionButton = $("#enter-protected-session-button");
const $protectedSessionOffButton = $("#protected-session-off"); const $leaveProtectedSessionButton = $("#leave-protected-session-button");
let protectedSessionDeferred = null; let protectedSessionDeferred = null;
@ -77,8 +77,8 @@ async function setupProtectedSession() {
protectedSessionDeferred.resolve(true); protectedSessionDeferred.resolve(true);
protectedSessionDeferred = null; protectedSessionDeferred = null;
$protectedSessionOnButton.addClass('active'); $enterProtectedSessionButton.hide();
$protectedSessionOffButton.removeClass('active'); $leaveProtectedSessionButton.show();
} }
infoService.showMessage("Protected session has been started."); infoService.showMessage("Protected session has been started.");

View File

@ -27,14 +27,17 @@
Recent changes Recent changes
</button> </button>
<div> <button class="btn btn-sm" id="enter-protected-session-button" title="Enter protected session to be able to find and view protected notes">
<span style="font-size: smaller">Protected session:</span> <span class="jam jam-door"></span>
<div class="btn-group btn-group-xs"> Enter protected session
<button type="button" class="btn" id="protected-session-on">On</button> </button>
<button type="button" class="btn active" id="protected-session-off">Off</button>
</div> <button class="btn btn-sm" id="leave-protected-session-button" title="Leave protected session so that protected notes are not accessible any more." style="display: none;">
</div> <span class="jam jam-log-out"></span>
Leave protected session
</button>
</div> </div>
<div id="plugin-buttons"> <div id="plugin-buttons">