Distinguish between locked and protected notes
This commit is contained in:
@@ -422,6 +422,11 @@ angular.module('app')
|
||||
this.changesMade({dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
}
|
||||
|
||||
this.toggleProtectNote = function() {
|
||||
this.note.content.protected = !this.note.content.protected;
|
||||
this.changesMade({dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
}
|
||||
|
||||
this.toggleNotePreview = function() {
|
||||
this.note.content.hidePreview = !this.note.content.hidePreview;
|
||||
this.changesMade({dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
|
||||
@@ -218,8 +218,8 @@ angular.module('app')
|
||||
})
|
||||
}
|
||||
|
||||
if(note.locked && await privilegesManager.actionRequiresPrivilege(PrivilegesManager.ActionViewLockedNotes)) {
|
||||
privilegesManager.presentPrivilegesModal(PrivilegesManager.ActionViewLockedNotes, () => {
|
||||
if(note.content.protected && await privilegesManager.actionRequiresPrivilege(PrivilegesManager.ActionViewProtectedNotes)) {
|
||||
privilegesManager.presentPrivilegesModal(PrivilegesManager.ActionViewProtectedNotes, () => {
|
||||
run();
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -44,7 +44,7 @@ class AuthManager extends SFAuthManager {
|
||||
this.storageManager.setItemsMode(StorageManager.Ephemeral);
|
||||
} else {
|
||||
this.storageManager.setModelStorageMode(StorageManager.Fixed);
|
||||
this.storageManager.setItemsMode(this.storageManager.hasPasscode() ? StorageManager.FixedEncrypted : StorageManager.Fixed);
|
||||
this.storageManager.setItemsMode(this.storageManager.bestStorageMode());
|
||||
this.storageManager.setItem("ephemeral", JSON.stringify(false), StorageManager.Fixed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class PrivilegesManager {
|
||||
|
||||
PrivilegesManager.ActionManageExtensions = "ActionManageExtensions";
|
||||
PrivilegesManager.ActionManageBackups = "ActionManageBackups";
|
||||
PrivilegesManager.ActionViewLockedNotes = "ActionViewLockedNotes";
|
||||
PrivilegesManager.ActionViewProtectedNotes = "ActionViewProtectedNotes";
|
||||
PrivilegesManager.ActionManagePrivileges = "ActionManagePrivileges";
|
||||
PrivilegesManager.ActionManagePasscode = "ActionManagePasscode";
|
||||
PrivilegesManager.ActionDeleteNote = "ActionDeleteNote";
|
||||
@@ -34,7 +34,7 @@ class PrivilegesManager {
|
||||
PrivilegesManager.ActionManageExtensions,
|
||||
PrivilegesManager.ActionManageBackups,
|
||||
PrivilegesManager.ActionManagePasscode,
|
||||
PrivilegesManager.ActionViewLockedNotes,
|
||||
PrivilegesManager.ActionViewProtectedNotes,
|
||||
PrivilegesManager.ActionDeleteNote
|
||||
]
|
||||
|
||||
@@ -174,8 +174,8 @@ class PrivilegesManager {
|
||||
label: "Download/Import Backups"
|
||||
};
|
||||
|
||||
metadata[PrivilegesManager.ActionViewLockedNotes] = {
|
||||
label: "View Locked Notes"
|
||||
metadata[PrivilegesManager.ActionViewProtectedNotes] = {
|
||||
label: "View Protected Notes"
|
||||
};
|
||||
|
||||
metadata[PrivilegesManager.ActionManagePrivileges] = {
|
||||
@@ -224,8 +224,8 @@ class PrivilegesManager {
|
||||
let expiresAt = addToNow(length);
|
||||
|
||||
return Promise.all([
|
||||
this.storageManager.setItem(PrivilegesManager.SessionExpiresAtKey, JSON.stringify(expiresAt), StorageManager.FixedEncrypted),
|
||||
this.storageManager.setItem(PrivilegesManager.SessionLengthKey, JSON.stringify(length), StorageManager.FixedEncrypted),
|
||||
this.storageManager.setItem(PrivilegesManager.SessionExpiresAtKey, JSON.stringify(expiresAt), this.storageManager.bestStorageMode()),
|
||||
this.storageManager.setItem(PrivilegesManager.SessionLengthKey, JSON.stringify(length), this.storageManager.bestStorageMode()),
|
||||
])
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ class PrivilegesManager {
|
||||
}
|
||||
|
||||
async getSelectedSessionLength() {
|
||||
let length = await this.storageManager.getItem(PrivilegesManager.SessionLengthKey, StorageManager.FixedEncrypted);
|
||||
let length = await this.storageManager.getItem(PrivilegesManager.SessionLengthKey, this.storageManager.bestStorageMode());
|
||||
if(length) {
|
||||
return JSON.parse(length);
|
||||
} else {
|
||||
@@ -243,7 +243,7 @@ class PrivilegesManager {
|
||||
}
|
||||
|
||||
async getSessionExpirey() {
|
||||
let expiresAt = await this.storageManager.getItem(PrivilegesManager.SessionExpiresAtKey, StorageManager.FixedEncrypted);
|
||||
let expiresAt = await this.storageManager.getItem(PrivilegesManager.SessionExpiresAtKey, this.storageManager.bestStorageMode());
|
||||
if(expiresAt) {
|
||||
return new Date(JSON.parse(expiresAt));
|
||||
} else {
|
||||
|
||||
@@ -174,6 +174,10 @@ class StorageManager extends SFStorageManager {
|
||||
return this.getItemSync("encryptedStorage", StorageManager.Fixed) !== null;
|
||||
}
|
||||
|
||||
bestStorageMode() {
|
||||
return this.hasPasscode() ? StorageManager.FixedEncrypted : StorageManager.Fixed;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Model Storage
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
.ion-bookmark:before,
|
||||
.ion-locked:before,
|
||||
.ion-arrow-return-left:before,
|
||||
.ion-arrow-return-right:before
|
||||
.ion-arrow-return-right:before,
|
||||
.ion-key:before,
|
||||
.ion-lock-combination:before,
|
||||
.ion-eye-disabled:before
|
||||
{
|
||||
display: inline-block; font-family: "Ionicons"; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; text-rendering: auto; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
@@ -32,4 +35,10 @@
|
||||
|
||||
.ion-arrow-return-right:before { content: "\f266"; }
|
||||
|
||||
.ion-key:before { content: "\f296"; }
|
||||
|
||||
.ion-lock-combination:before { content: "\f4d4"; }
|
||||
|
||||
.ion-eye-disabled:before { content: "\f306"; }
|
||||
|
||||
/*# sourceMappingURL=ionicons.css.map */
|
||||
|
||||
@@ -153,13 +153,16 @@
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.note-flag {
|
||||
color: var(--sn-stylekit-info-color);
|
||||
}
|
||||
|
||||
.note-flags {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.pinned, .archived {
|
||||
color: var(--sn-stylekit-info-color);
|
||||
.note-flag {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
@@ -181,7 +184,7 @@
|
||||
background-color: var(--sn-stylekit-info-color);
|
||||
color: var(--sn-stylekit-info-contrast-color);
|
||||
|
||||
.pinned, .archived {
|
||||
.note-flag {
|
||||
color: var(--sn-stylekit-info-contrast-color);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
%input{"type" => "checkbox", "ng-disabled" => "!credentialDisplayInfo[credential].availability", "ng-checked" => "isCredentialRequiredForAction(action, credential)", "ng-click" => "checkboxValueChanged(action, credential)"}
|
||||
|
||||
.sk-panel-section{"ng-if" => "sessionExpirey && !sessionExpired"}
|
||||
.sk-p You will not be asked to authenticate until {{sessionExpirey}}.
|
||||
%a.sk-a {"ng-click" => "clearSession()"} Clear Session
|
||||
.sk-p.sk-panel-row You will not be asked to authenticate until {{sessionExpirey}}.
|
||||
%a.sk-a.sk-panel-row.info{"ng-click" => "clearSession()"} Clear Session
|
||||
.sk-panel-footer
|
||||
.sk-h2 About Privileges
|
||||
.sk-panel-section.no-bottom-pad
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
%menu-row{"label" => "ctrl.note.pinned ? 'Unpin' : 'Pin'", "action" => "ctrl.selectedMenuItem(true); ctrl.togglePin()", "desc" => "'Pin or unpin a note from the top of your list'"}
|
||||
%menu-row{"label" => "ctrl.note.archived ? 'Unarchive' : 'Archive'", "action" => "ctrl.selectedMenuItem(true); ctrl.toggleArchiveNote()", "desc" => "'Archive or unarchive a note from your Archived system tag'"}
|
||||
%menu-row{"label" => "ctrl.note.locked ? 'Unlock' : 'Lock'", "action" => "ctrl.selectedMenuItem(true); ctrl.toggleLockNote()", "desc" => "'Locking notes prevents unintentional editing'"}
|
||||
%menu-row{"label" => "ctrl.note.content.protected ? 'Unprotect' : 'Protect'", "action" => "ctrl.selectedMenuItem(true); ctrl.toggleProtectNote()", "desc" => "'Protecting a note will require credentials to view it (Manage Privileges via Account menu)'"}
|
||||
%menu-row{"label" => "'Preview'", "circle" => "ctrl.note.content.hidePreview ? 'danger' : 'success'", "circle-align" => "'right'", "action" => "ctrl.selectedMenuItem(true); ctrl.toggleNotePreview()", "desc" => "'Hide or unhide the note preview from the list of notes'"}
|
||||
%menu-row{"label" => "'Delete'", "action" => "ctrl.selectedMenuItem(); ctrl.deleteNote()", "desc" => "'Delete this note permanently from all your devices'"}
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@
|
||||
%strong.red.medium-text{"ng-if" => "note.errorDecrypting"} Unable to Decrypt
|
||||
|
||||
.note-flags
|
||||
.pinned{"ng-if" => "note.pinned"}
|
||||
.pinned.note-flag{"ng-if" => "note.pinned"}
|
||||
%i.icon.ion-bookmark
|
||||
%strong.medium-text Pinned
|
||||
|
||||
.archived{"ng-if" => "note.archived && !ctrl.tag.isSmartTag()"}
|
||||
.archived.note-flag{"ng-if" => "note.archived && !ctrl.tag.isSmartTag()"}
|
||||
%i.icon.ion-ios-box
|
||||
%strong.medium-text Archived
|
||||
|
||||
@@ -62,8 +62,10 @@
|
||||
.faded {{note.savedTagsString || note.tagsString()}}
|
||||
|
||||
.name{"ng-if" => "note.title"}
|
||||
%span.locked.tinted{"ng-if" => "note.locked", "ng-class" => "{'tinted-selected' : ctrl.selectedNote == note}"}
|
||||
%span.note-flag{"ng-show" => "note.locked"}
|
||||
%i.icon.ion-locked.medium-text
|
||||
%span.note-flag{"ng-show" => "note.content.protected"}
|
||||
%i.icon.ion-eye-disabled
|
||||
{{note.title}}
|
||||
|
||||
.note-preview{"ng-if" => "!ctrl.hideNotePreview && !note.content.hidePreview && !note.locked"}
|
||||
|
||||
BIN
dist/assets/ionicons.eot
vendored
BIN
dist/assets/ionicons.eot
vendored
Binary file not shown.
18
dist/assets/ionicons.svg
vendored
18
dist/assets/ionicons.svg
vendored
@@ -5,7 +5,7 @@
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
|
||||
<metadata>
|
||||
Created by FontForge 20170925 at Thu Dec 13 12:01:05 2018
|
||||
Created by FontForge 20170925 at Thu Dec 13 12:46:07 2018
|
||||
By mo
|
||||
Copyright (c) 2018, mo
|
||||
</metadata>
|
||||
@@ -19,16 +19,28 @@ Copyright (c) 2018, mo
|
||||
panose-1="2 0 5 3 0 0 0 0 0 0"
|
||||
ascent="448"
|
||||
descent="-64"
|
||||
bbox="0 -32 384 416"
|
||||
bbox="0 -64 448 448"
|
||||
underline-thickness="25.6"
|
||||
underline-position="-51.2"
|
||||
unicode-range="U+F200-F3EC"
|
||||
unicode-range="U+F200-F4D4"
|
||||
/>
|
||||
<missing-glyph />
|
||||
<glyph glyph-name="ion-ios-box" unicode="" horiz-adv-x="320"
|
||||
d="M16 48v192h288v-192h-288zM128 208c-9 0 -16 -7 -16 -16s7 -16 16 -16h64c9 0 16 7 16 16s-7 16 -16 16h-64zM0 336h320v-80h-16h-288h-16v80z" />
|
||||
<glyph glyph-name="ion-lock-combination" unicode=""
|
||||
d="M320 271c39 -35 64 -86 64 -143c0 -106 -86 -192 -192 -192s-192 86 -192 192c0 57 25 108 64 143v49c0 71 57 128 128 128s128 -57 128 -128v-49zM96 320v-26c28 16 61 26 96 26s68 -10 96 -26v26c0 53 -43 96 -96 96s-96 -43 -96 -96zM192 -32c88 0 160 72 160 160
|
||||
s-72 160 -160 160s-160 -72 -160 -160s72 -160 160 -160zM192 272c80 0 144 -64 144 -144s-64 -144 -144 -144s-144 64 -144 144s64 144 144 144zM315 95c2 9 4 18 4 29h-7v7h8c0 11 -2 20 -5 30l-25 -7l-4 12l25 8c-4 10 -8 18 -14 26l-11 -8l-4 6l11 8c-6 8 -13 16 -21 22
|
||||
l-15 -21l-11 8l15 20c-8 6 -17 11 -27 14l-4 -13l-6 2l5 13c-9 3 -20 5 -29 5v-13v-6h-16v6v13c-11 -1 -19 -2 -29 -5l4 -12l-6 -2l-4 12c-10 -3 -19 -8 -27 -14l15 -20l-10 -8l-15 21c-8 -6 -16 -14 -22 -22l11 -8l-4 -5l-10 8c-6 -8 -10 -17 -14 -27l24 -8l-5 -12l-25 7
|
||||
c-3 -10 -3 -19 -3 -30h6v-7h-5c0 -11 2 -20 4 -29l24 7l4 -12l-24 -8c4 -10 8 -19 14 -27l9 7l4 -5l-9 -7c6 -8 13 -16 21 -22l15 21l10 -8l-15 -20c8 -5 17 -11 27 -14l3 11l7 -2l-4 -11c10 -3 18 -4 29 -5v13v6h16v-6v-13c9 1 19 2 29 5l-5 12l6 2l4 -12c10 3 19 8 27 14
|
||||
l-15 20l11 8l15 -21c8 6 15 14 21 22l-11 7l4 6l10 -8c6 8 11 17 15 27l-25 8l4 12zM111 128c0 45 36 81 81 81s81 -36 81 -81s-36 -81 -81 -81s-81 36 -81 81z" />
|
||||
<glyph glyph-name="ion-arrow-return-right" unicode=""
|
||||
d="M384 256l-128 -96v64h-192v-128h248c4 0 8 -4 8 -8v-48c0 -4 -4 -8 -8 -8h-304c-4 0 -8 4 -8 8v240c0 4 4 8 8 8h248v64z" />
|
||||
<glyph glyph-name="ion-key" unicode="" horiz-adv-x="192"
|
||||
d="M144 147c28 -17 48 -48 48 -83c0 -53 -43 -96 -96 -96s-96 43 -96 96c0 36 19 67 48 84c0 0 7 16 12 41c0 4 11 6 11 12v20c0 5 -7 9 -7 11v8v8c0 2 0 4 1 6c0 1 1 1 1 2l2 1l4 4v1c2 2 3 4 3 6c0 1 1 8 1 9c0 3 -2 6 -4 8l-1 1l-4 4v0l-1 1v0c-2 2 -3 5 -3 8v7
|
||||
c0 3 2 7 4 9v0l5 5v0c2 2 4 3 4 6v24c0 3 -2 6 -4 8v1l-4 4l-1 1c-2 2 -3 5 -3 8v18c0 11 0 19 9 23c3 1 14 3 23 3c20 0 30 -8 32 -36c0 0 7 -81 9 -143s7 -90 7 -90zM96 0c18 0 32 14 32 32s-14 32 -32 32s-32 -14 -32 -32s14 -32 32 -32z" />
|
||||
<glyph glyph-name="ion-eye-disabled" unicode="" horiz-adv-x="448"
|
||||
d="M344 290c41 -27 76 -66 104 -100c-51 -54 -124 -135 -224 -135c-36 0 -65 8 -92 22l-77 -77l-23 23l71 71c-36 25 -68 61 -103 98c78 85 142 137 224 137c34 0 64 -9 92 -23l77 78l23 -23zM134 192c0 -19 6 -36 16 -51l27 27c-4 7 -5 15 -5 24c0 29 23 53 52 53h8
|
||||
c-5 -6 -8 -13 -8 -21c0 -3 0 -5 1 -8l51 50c-15 11 -33 17 -52 17c-49 0 -90 -41 -90 -91zM224 101c49 0 90 41 90 91c0 19 -6 37 -16 52l-50 -51c3 -1 5 -1 8 -1c8 0 14 3 20 7v-7c0 -29 -23 -53 -52 -53c-9 0 -17 2 -24 6l-28 -27c15 -11 33 -17 52 -17z" />
|
||||
<glyph glyph-name="ion-arrow-return-left" unicode=""
|
||||
d="M128 352v-64h248c4 0 8 -4 8 -8v-240c0 -4 -4 -8 -8 -8h-304c-4 0 -8 4 -8 8v48c0 4 4 8 8 8h248v128h-192v-64l-128 96z" />
|
||||
<glyph glyph-name="ion-bookmark" unicode="" horiz-adv-x="192"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
dist/assets/ionicons.ttf
vendored
BIN
dist/assets/ionicons.ttf
vendored
Binary file not shown.
BIN
dist/assets/ionicons.woff
vendored
BIN
dist/assets/ionicons.woff
vendored
Binary file not shown.
Reference in New Issue
Block a user